Slackbot
04/13/2023, 4:51 PMJavi
04/13/2023, 4:51 PMOutput:
Encryption of the configuration cache is enabled.
Calculating task graph as no configuration cache is available for tasks: fooTask
0 problems were found storing the configuration cache.
See the complete report at ...
FAILURE: Build failed with an exception.
* What went wrong:
Failed to create MD5 hash for file content.
> The process cannot access the file because another process has locked a portion of the file
Chris Lee
04/13/2023, 4:52 PMJavi
04/13/2023, 4:59 PMinternal fun Settings.extractedProjects(): Set<String> =
settingsDir
.walkTopDown()
.onEnter { file -> file.shouldContinueVisiting(settings) }
.flatMap { file ->
val children = file.listFiles()?.filter { child -> child.isProject }
children?.map { child -> child.relativeTo(settingsDir).path }.orEmpty()
}
.toSet()
Javi
04/13/2023, 5:00 PMval children = file.listFiles()?.filter { child -> child.isProject }
probably caused by listFiles()
Chris Lee
04/13/2023, 5:01 PMJavi
04/13/2023, 5:04 PM_walkTopDown_().maxDepth(1)
Vampire
04/13/2023, 5:16 PMisProject
? Does it maybe open the file but not close it?Javi
04/13/2023, 5:38 PMprivate val File.isProject: Boolean
get() = hasBuildGradle && !isSettingsProject
Javi
04/13/2023, 5:39 PMJavi
04/13/2023, 5:40 PMlistFiles()
too, after moving to walkTopDown
the issue is goneJavi
04/13/2023, 5:40 PMlistFiles
thoChris Lee
04/13/2023, 5:41 PMlistFiles
doesn’t need resource cleanup. it was likely related to walking through the entire tree, limiting your search has reduced/removed the contention.Javi
04/13/2023, 5:45 PMChris Lee
04/13/2023, 5:47 PM_walkTopDown_().maxDepth(1)
Javi
04/13/2023, 5:49 PMinternal fun Settings.extractedProjects(): Set<String> =
settingsDir
.walkTopDown()
.onEnter { file -> file.shouldContinueVisiting(settings) }
.flatMap { file ->
val children = file.listFiles()?.filter { child -> child.isProject }
children?.map { child -> child.relativeTo(settingsDir).path }.orEmpty()
}
.toSet()
to
internal fun Settings.extractedProjects(): Set<String> =
settingsDir
.walkTopDown()
.onEnter { file -> file.shouldContinueVisiting(settings) }
.flatMap { file ->
val children = (file.walkTopDown().maxDepth(1) - file).filter { child -> child.isProject }
children.map { child -> child.relativeTo(settingsDir).path }
}
.toSet()
I think both are checking the exactly same files