-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Concurrency issues with multiple XjcGenerate task executions? #33
Comments
Can you confirm there is only a single xjcGenerate execution per module and each module has its own build output directory to itself ? It certainly looks like there isn't support for multiple xjcGenerate tasks per module. One aspect is the task calling cleanOutputDirs() early in generate(). https://github.com/unbroken-dome/gradle-xjc-plugin/blob/master/src/main/kotlin/org/unbrokendome/gradle/plugins/xjc/XjcGenerate.kt#L181 However I don't see that being the cause of your exceptions. I too have seen such random errors that disappear by running the tool again. UPDATED: The support for multiple xjcGenerate tasks is in the use of multiple sourceSets by different names, like src/main/schema and src/alt/schema and src/another/schema the clean I talk of above only cleans a single sourceSet label at a time, like 'main' or 'alt' or 'another' this is the mechanism for concurrency in a single project AFAIKS. |
@chrisdennis Can you confirm if you are using Windows ? are you using catalogs ? or classpath: or maven: references ? I have not experienced any concurrency issues since doing the work for PR #47 and using the plugin over the past weeks (but I did not try to specifically address anything related to 'concurrency' in the PR, I did however provide a fix/workaround for Windows platform JAR locking from open file handle with long running Gradle process when catalogs/xml-resolver was being used). Looking at your stack trace again, seeing references to #resolve() and seeing 'jar:file' and 'Stream closed' errors, I think the commits related to my Issue #48 have also addressed this bug report. |
Sorry... should have got back on this when I saw the earlier comment. I saw this reproducing on both Windows and MacOS, and yes, the build is using catalogs with |
Thanks for your comment, no problem on delay. Description of the sequence of events that may cause it on MacOS/Linux:
This OpenJDK bug report provided much information to me to help confirm it was relevant to the situation fixed by my commits. https://bugs.openjdk.org/browse/JDK-8246714 FWIW: I am not saying the cache poisoning described in the bug is being trigger by Gradle, it is just good background to underestand something not so obvious happening inside the JVM process. The bug here is the inconsistent state of the internal JarFile cache and the real-world disk data, due to Gradle being a build system and due to repeated clean, build, clean, build and Gradle long running daemon driving those targets in a background process. This should be preventable with a workaround, by ensuring you shutdown the gradle daemon between builds, then you should not be able to observe any problem, as this effectively invalidate that internal cache. HTH |
I hesitate to file this as an issue since I have little solid evidence pointing to what the actual bug is here. In my multi-module project with three separate
XjcGenerate
executions in three different modules I see occasional failures (1 in every 20 or more builds). When constraining the XjcGenerate tasks to run one at a time these failures seem to disappear (based on my current testing).Environment (reproduces across both Windows and MacOS):
Examples of the exceptions I'm seeing:
The text was updated successfully, but these errors were encountered: