Skip to content
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

[JENKINS-26380] Terminate nodes correctly #2

Merged
merged 1 commit into from
Jan 13, 2015

Conversation

stephenc
Copy link
Member

JENKINS-26380

Supersedes #1.

@jenkinsadmin
Copy link
Member

Thank you for a pull request! Please check this document for how the Jenkins project handles pull requests

if (terminating) {
return;
}
terminating = true;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like an AtomicBoolean would be more idiomatic, but perhaps you need the monitor on OnceRetentionStrategy.this anyway to be exclusive with the threadPoolForRemoting thread?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

correct we want the lock here to ensure exclusivity of starting the background task

@jglick
Copy link
Member

jglick commented Jan 13, 2015

Do not really follow the implications of the change, but seems OK to merge to me.

@jglick
Copy link
Member

jglick commented Jan 13, 2015

Is this intended to be a final fix of JENKINS-26380, or do you expect other retention strategies are also in danger from the core locking change?

@stephenc
Copy link
Member Author

@jglick other retention strategies are already broken if they didn't acquire the lock on Queue before checking idle and then in the background repeat after reacquiring the lock on Queue. The core change makes it easier to do that.

It does not make sense to add the lock to Jenkins.removeNode as there may be valid cases where you want to remove the node and jobs in progress be damned... hence it is up to the caller to ensure they have the correct lock based on whether the node being idle is important to them or not

stephenc added a commit that referenced this pull request Jan 13, 2015
[JENKINS-26380] Terminate nodes correctly
@stephenc stephenc merged commit cce88ca into jenkinsci:master Jan 13, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants