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

Make ContentContainer.contents thread-safe #437

Merged
merged 1 commit into from
Feb 1, 2023
Merged

Conversation

jglick
Copy link
Member

@jglick jglick commented Feb 1, 2023

I observed an error

java.util.ConcurrentModificationException
	at java.base/java.util.ArrayList$Itr.checkForComodification(ArrayList.java:1043)
	at java.base/java.util.ArrayList$Itr.next(ArrayList.java:997)
	at com.cloudbees.jenkins.support.SupportPlugin.writeBundle(SupportPlugin.java:374)
	at com.cloudbees.jenkins.support.SupportPlugin.writeBundle(SupportPlugin.java:330)
	at com.cloudbees.jenkins.support.SupportPlugin$PeriodicWorkImpl.lambda$doRun$0(SupportPlugin.java:888)

where the line number points to

I suppose some component must have called Container.add outside the dynamic scope of Component.addContents (from another thread); unusual but not specifically forbidden. Safer to make the list of contents be thread-safe, and have appendManifestContents produce a snapshot.

@jglick jglick requested a review from a team as a code owner February 1, 2023 20:53
@jglick jglick added the bug label Feb 1, 2023
@jglick jglick requested a review from Vlatombe February 1, 2023 20:53
@Dohbedoh Dohbedoh merged commit 665d89f into jenkinsci:master Feb 1, 2023
@jglick jglick deleted the CME branch February 2, 2023 00:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants