Open james-s-w-clark opened 2 years ago
This looks like the jar is either still in use, or some process forget to close the file resource. If you don't have other processes using this jar file, chances are, that Mill itself (or zinc) is keeping it open. I already fixed some resource leaks in Mill in the past, to get Windows CI working, so there is definitely code which was written without resources management in mind. Although I reviewed many sensitive parts, any help is much appreciated.
@lefou I'll try and have a look. It seems there's already some Zinc issues for local tests on Windows:
X mill.integration.forked.ZincIncrementalCompilationTests.incremental compilation only compiles changed files 13634ms
utest.AssertionError: assert(modelInfo1.ctime == modelInfo2.ctime)
modelInfo1: os.StatInfo = StatInfo(5641,2022-07-12T08:17:19.8867586Z,2022-07-12T08:17:20.006868Z,2022-07-12T08:17:19.8857575Z,File)
modelInfo2: os.StatInfo = StatInfo(5641,2022-07-12T08:17:19.8867586Z,2022-07-12T08:17:24.5620146Z,2022-07-12T08:17:19.8857575Z,File)
utest.asserts.Asserts$.assertImpl(Asserts.scala:30)
mill.integration.ZincIncrementalCompilationTests.$anonfun$tests$2(ZincIncrementalCompilationTests.scala:39)
1 targets failed
integration.forked.test 1 tests failed:
mill.integration.forked.ZincIncrementalCompilationTests mill.integration.forked.ZincIncrementalCompilationTests.incremental compilation only compiles changed files
If you could link any issues/PRs/discussion on Zinc to help me understand what it is, it'd be very helpful. I don't know much about how Mill works etc. 👍
@lefou I'll try and have a look. It seems there's already some Zinc issues for local tests on Windows:
X mill.integration.forked.ZincIncrementalCompilationTests.incremental compilation only compiles changed files 13634ms utest.AssertionError: assert(modelInfo1.ctime == modelInfo2.ctime) modelInfo1: os.StatInfo = StatInfo(5641,2022-07-12T08:17:19.8867586Z,2022-07-12T08:17:20.006868Z,2022-07-12T08:17:19.8857575Z,File) modelInfo2: os.StatInfo = StatInfo(5641,2022-07-12T08:17:19.8867586Z,2022-07-12T08:17:24.5620146Z,2022-07-12T08:17:19.8857575Z,File) utest.asserts.Asserts$.assertImpl(Asserts.scala:30) mill.integration.ZincIncrementalCompilationTests.$anonfun$tests$2(ZincIncrementalCompilationTests.scala:39) 1 targets failed integration.forked.test 1 tests failed: mill.integration.forked.ZincIncrementalCompilationTests mill.integration.forked.ZincIncrementalCompilationTests.incremental compilation only compiles changed files
If you could link any issues/PRs/discussion on Zinc to help me understand what it is, it'd be very helpful. I don't know much about how Mill works etc. +1
Those are new and probably introduced between Zinc 1.7.0-M2 and 1.7.0 (final). E.g. PR #1845 which ran successfully with 1.7.0-M2 before I updated it to 1.7.0. That's also a good example, why I try to isolate version bumps.
@IdiosApps I tried using https://github.com/jenkinsci/lib-file-leak-detector to find which files remain unclosed.
Found that there are 3 places where it gets stuck/unclosed. You can see attached file for stacktraces.
Couldn't find any place where it would be unclosed in Mill codebase... :/
@lefou I'll try and have a look. It seems there's already some Zinc issues for local tests on Windows:
X mill.integration.forked.ZincIncrementalCompilationTests.incremental compilation only compiles changed files 13634ms utest.AssertionError: assert(modelInfo1.ctime == modelInfo2.ctime) modelInfo1: os.StatInfo = StatInfo(5641,2022-07-12T08:17:19.8867586Z,2022-07-12T08:17:20.006868Z,2022-07-12T08:17:19.8857575Z,File) modelInfo2: os.StatInfo = StatInfo(5641,2022-07-12T08:17:19.8867586Z,2022-07-12T08:17:24.5620146Z,2022-07-12T08:17:19.8857575Z,File) utest.asserts.Asserts$.assertImpl(Asserts.scala:30) mill.integration.ZincIncrementalCompilationTests.$anonfun$tests$2(ZincIncrementalCompilationTests.scala:39) 1 targets failed integration.forked.test 1 tests failed: mill.integration.forked.ZincIncrementalCompilationTests mill.integration.forked.ZincIncrementalCompilationTests.incremental compilation only compiles changed files
If you could link any issues/PRs/discussion on Zinc to help me understand what it is, it'd be very helpful. I don't know much about how Mill works etc. +1
Those are new and probably introduced between Zinc 1.7.0-M2 and 1.7.0 (final). E.g. PR #1845 which ran successfully with 1.7.0-M2 before I updated it to 1.7.0. That's also a good example, why I try to isolate version bumps.
Those are fixed now in Zinc 1.7.1, which was merged into master.
@IdiosApps I tried using https://github.com/jenkinsci/lib-file-leak-detector to find which files remain unclosed. Found that there are 3 places where it gets stuck/unclosed. You can see attached file for stacktraces. Couldn't find any place where it would be unclosed in Mill codebase... :/
Much appreciated! Yeah, looks like those were opened in Zinc but never closed. I'm not very familiar with sbt/zinc code base, but just from looking at it, I'd bet it's the plugin loading mechanism. Resources issues in normal classpath handling would be probably detected by many others, whereas comsuming locally built plugins which also change frequently is probably rather uncommon.
I reported the issue upstream.
I'm checking compilation locally to reduce CI job runs (that's a different story though).
When I re-run a compilation (![image](https://user-images.githubusercontent.com/12559216/178371872-bc20e70b-f3b8-443a-b350-149092046dc9.png)
mill contrib.flyway.compile
), I get an error - which I can solve by killing the only "java.exe" process. This stackoverflow answer helped me get the compilation running again. Windows wouldn't let me delete the Jar:I've worked around it for now. I raised this in case someone else gets the same compilation problems on Windows.