-
Notifications
You must be signed in to change notification settings - Fork 21
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
Revert optimization that sometimes caused infinite loops in TreeMaps #793
Revert optimization that sometimes caused infinite loops in TreeMaps #793
Conversation
The BuildServicesRegistry is apparently not thread-safe, so we need to either move this registration to during Gradle configuration or use some other caching mechanism (e.g. put a cache object on an extension of the root project). I have left ConjureRunnerResource mostly intact with the expectation that it will be either used or removed in a subsequent fix of the optimization.
Generate changelog in
|
try { | ||
ConjureRunnerResource.createNewRunner(executable).invoke(project, failedTo, unloggedArgs, loggedArgs); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we would need to close the classloader after execution in this case:
try { | |
ConjureRunnerResource.createNewRunner(executable).invoke(project, failedTo, unloggedArgs, loggedArgs); | |
try (ConjureRunner runner = ConjureRunnerResource.createNewRunner(executable)) { | |
runner.invoke(project, failedTo, unloggedArgs, loggedArgs); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, done
@AlexLandau Do we have an upstream gradle ticket tracking this? I can't imagine the BuildServicesRegistry would be intentionally non-threadsafe. Happy to cut a release with this for now given the failures we're seeing internally, that behavior is clearly broken. 👍 |
Released 5.9.0 |
I filed gradle/gradle#17434. It may be intended that registering a shared service only happens during (single-threaded) configuration, with tasks getting access to the service through a Property; that's how you'd have to use it to take advantage of configuration caching or limiting concurrent usage of the service. |
The BuildServicesRegistry is apparently not thread-safe, so we
need to either move this registration to during Gradle configuration
or use some other caching mechanism (e.g. put a cache object on an
extension of the root project).
I have left ConjureRunnerResource intact with the expectation
that it will be either used or removed in a subsequent fix of the
optimization. This PR is just to quickly get to a state where we
don't run into this problem.
==COMMIT_MSG==
Revert a performance optimization for large builds that sometimes resulted in hangs due to infinite loops in TreeMap#get.
==COMMIT_MSG==