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

Fix ConcurrentModificationException for files actions #120

Merged
merged 5 commits into from Oct 29, 2020

Conversation

v1v
Copy link
Member

@v1v v1v commented Oct 25, 2020

Synchronised the files list to prevent the build serialisation job to access it and throw ConcurrentModificationException .

What did I try?

  • newConcurrentHashSet

I used newConcurrentHashSet rather than the newHashSet method from the google-http-client dependency since it does not support concurrentHash set as far as I see

but it failed when deploying it in one of my production jenkins instance

java.lang.NoSuchMethodError: com.google.common.collect.Sets.newConcurrentHashSet()Ljava/util/Set;

Closes #61

@v1v v1v marked this pull request as ready for review October 26, 2020 08:55
Comment on lines 38 to 39
this.buckets = Sets.newConcurrentHashSet();
this.files = Sets.newConcurrentHashSet();
Copy link
Member Author

Choose a reason for hiding this comment

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

This particular methods doesn't seem to work in our existing instance

java.lang.NoSuchMethodError: com.google.common.collect.Sets.newConcurrentHashSet()Ljava/util/Set;
19:56:27  	at com.google.jenkins.plugins.storage.reports.BuildGcsUploadReport.<init>(BuildGcsUploadReport.java:38)
19:56:27  	at com.google.jenkins.plugins.storage.reports.BuildGcsUploadReport.of(BuildGcsUploadReport.java:74)
19:56:27  	at com.google.jenkins.plugins.storage.AbstractUpload.perform(AbstractUpload.java:173)
19:56:27  	at com.google.jenkins.plugins.storage.ClassicUploadStep.perform(ClassicUploadStep.java:183)
19:56:27  	at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:80)
19:56:27  	at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:67)
19:56:27  	at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)
19:56:27  	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
19:56:27  	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
19:56:27  	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
19:56:27  	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
19:56:27  	at java.lang.Thread.run(Thread.java:748)
19:56:27  Finished: FAILURE

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.

None yet

2 participants