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 when iterating through connection #922

Merged
merged 1 commit into from Aug 12, 2019

Conversation

hovis
Copy link
Contributor

@hovis hovis commented Jul 30, 2019

Fix ConcurrentModificationException when iterating through connections returned by getConnections()

Description

Wrap new ArrayList(connections) in synchronized to avoid ConcurrentModificationException

Related Issue

Issue #921
Also related to #902

Motivation and Context

ConcurrentModificationException when looping connections and a connection is created/removed elsewhere at the same time.

How Has This Been Tested?

Tested in production with a tight loop iterating over connections gathering statistics whilst connections are made/removed elsewhere. No more cases of ConcurrentModificationException after the fix.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@marci4 marci4 added this to the Release 1.4.1 milestone Aug 12, 2019
@marci4 marci4 merged commit 8fcd4d1 into TooTallNate:master Aug 12, 2019
@marci4 marci4 changed the title Fix ConcurrentModificationException when iterating through connection… Fix ConcurrentModificationException when iterating through connection Mar 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants