Skip to content

Fix ConcurrentModificationException when flushing async log messages#2213

Merged
michaelbausor merged 2 commits intogoogleapis:masterfrom
stalar:master
Jul 6, 2017
Merged

Fix ConcurrentModificationException when flushing async log messages#2213
michaelbausor merged 2 commits intogoogleapis:masterfrom
stalar:master

Conversation

@stalar
Copy link
Copy Markdown

@stalar stalar commented Jul 3, 2017

A missing synchronized statement when adding to pendingWrites cause
ConcurrentModificationExceptions in the flush() method when the
pendingWrites are copied to writesToFlush.

Fixes #2207.

@googlebot
Copy link
Copy Markdown

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed, please reply here (e.g. I signed it!) and we'll verify. Thanks.


  • If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check your existing CLA data and verify that your email is set on your git commits.
  • If your company signed a CLA, they designated a Point of Contact who decides which employees are authorized to participate. You may need to contact the Point of Contact for your company and ask to be added to the group of authorized contributors. If you don't know who your Point of Contact is, direct the project maintainer to go/cla#troubleshoot.
  • In order to pass this check, please resolve this problem and have the pull request author add another comment and the bot will run again.

@googlebot googlebot added the cla: no This human has *not* signed the Contributor License Agreement. label Jul 3, 2017
@coveralls
Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.002%) to 81.137% when pulling 18f5da9 on stalar:master into 2a92207 on GoogleCloudPlatform:master.

@coveralls
Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.01%) to 81.149% when pulling 916b4f0 on stalar:master into 2a92207 on GoogleCloudPlatform:master.

A missing synchronized statement when adding to pendingWrites cause
ConcurrentModificationExceptions in the flush() method when the
pendingWrites are copied to writesToFlush.
@coveralls
Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.006%) to 81.141% when pulling e7d1adf on stalar:master into 2a92207 on GoogleCloudPlatform:master.

@stalar
Copy link
Copy Markdown
Author

stalar commented Jul 3, 2017

I signed it!

Or at least Spotify signed it and I have tried to commit using my @spotify.com email address, but it does not look like it is working?

@stalar stalar closed this Jul 5, 2017
@stalar stalar reopened this Jul 5, 2017
@coveralls
Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.002%) to 81.137% when pulling e7d1adf on stalar:master into 2a92207 on GoogleCloudPlatform:master.

Copy link
Copy Markdown
Contributor

@michaelbausor michaelbausor left a comment

Choose a reason for hiding this comment

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

Thanks for the PR, this looks good!

Regarding the CLA, you could try:

Please let me know if those steps don't work, or if you don't know who your Point of Contact inside Spotify is to get added to the authorized contributors group.

logging.write(ImmutableList.of(LOG_ENTRY1));
logging.flush();
} catch (Exception ex) {
ex.printStackTrace();

This comment was marked as spam.

This comment was marked as spam.

@stalar
Copy link
Copy Markdown
Author

stalar commented Jul 6, 2017

Thanks for taking a look at the PR!

About the CLA:

  • My spotify email address is added to my GitHub account (although it wasn't when I created the commit and the pull request).
  • I have been added to the group of authorized contributors for Spotify

Should I just try a new PR?

@googlebot
Copy link
Copy Markdown

CLAs look good, thanks!

@googlebot googlebot added cla: yes This human has signed the Contributor License Agreement. and removed cla: no This human has *not* signed the Contributor License Agreement. labels Jul 6, 2017
@stalar
Copy link
Copy Markdown
Author

stalar commented Jul 6, 2017

Thanks googlebot!

@coveralls
Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.006%) to 81.141% when pulling 1356a05 on stalar:master into 2a92207 on GoogleCloudPlatform:master.

@michaelbausor michaelbausor merged commit 797d665 into googleapis:master Jul 6, 2017
@JoshuaFox
Copy link
Copy Markdown

Bug still occurs for me
Using com.google.cloud:google-cloud-logging:jar:1.16
Flexible Environment GA


java.util.ConcurrentModificationException at
 java.util.IdentityHashMap$KeySet.toArray(IdentityHashMap.java:1037) at
 java.util.IdentityHashMap$KeySet.toArray(IdentityHashMap.java:1015) at
 java.util.Collections$SetFromMap.toArray(Collections.java:5463) at
 java.util.ArrayList.addAll(ArrayList.java:577) at
 com.google.cloud.logging.LoggingImpl.flush(LoggingImpl.java:539) at
 com.google.cloud.logging.LoggingImpl.write(LoggingImpl.java:525) at
 com.google.cloud.logging.LoggingHandler.publish(LoggingHandler.java:273) at
 java.util.logging.Logger.log(Logger.java:738) at
 java.util.logging.Logger.doLog(Logger.java:765) at
 java.util.logging.Logger.log(Logger.java:788) at
 java.util.logging.Logger.severe(Logger.java:1464) a

suztomo pushed a commit to suztomo/google-cloud-java that referenced this pull request Mar 23, 2026
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants