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-24763] Prevent thread starvation in OldDataMonitor by reducing scope of synchronization #1402

Merged
merged 4 commits into from Oct 10, 2014

Conversation

recampbell
Copy link
Member

Supercedes #1399

@recampbell
Copy link
Member Author

@jglick @olivergondza, I reworked this to reduce the scope of synchronization and added a test which reproduces the issue

// test will hang here due to JENKINS-24763
OldDataMonitor.changeListener
.onChange(new Saveable() {public void save() throws IOException {}},
new XmlFile(File.createTempFile("somexmlfile","xml")));
Copy link
Member

Choose a reason for hiding this comment

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

No indication what program this is from, and no cleanup.

Copy link
Member Author

Choose a reason for hiding this comment

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

Resolved in 2e446fd

@olivergondza
Copy link
Member

LGTM


synchronized (this) {
for (SaveableReference ref : removed) {
data.remove(ref);
Copy link
Member

Choose a reason for hiding this comment

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

data.keySet().removeAll(removed) probably suffices, but not sure.

@recampbell
Copy link
Member Author

@jglick, if this looks OK, can you merge?

@jglick jglick merged commit 8bece68 into jenkinsci:master Oct 10, 2014
jglick added a commit that referenced this pull request Oct 10, 2014
@recampbell recampbell deleted the JENKINS-24763 branch October 24, 2014 20:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants