-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
Fix issue with Gradle daemons hanging indefinitely on shutdown #44867
Conversation
Pinging @elastic/es-core-infra |
clustersToWatch.removeAll(clustersToWatch); | ||
} | ||
public synchronized void unWatch(Collection<ElasticsearchCluster> cluster) { | ||
clustersToWatch.removeAll(clustersToWatch); |
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.
Shouldn't this be clustersToWatch.removeAll(cluster)
? (note, the name cluster
shoudl really be plural since it is a collection?
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. Looks like we were never actually registering this clusters to be watched.
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.
LGTM
This PR fixes and issue folks were reporting where Gradle daemons would be hung, such that the processes were still running but commands like
gradle --stop
didn't report them as running. The issue was were were inadvertently registering a shutdown hook that never completes. This caused the daemon on shutdown to unregister itself from the daemon registry (so it would never be reused) but the JVM would never actually exit.