Skip to content

Fix ConcurrentModificationException when iterating through connection#922

Merged
marci4 merged 1 commit into
TooTallNate:masterfrom
hovis:connectionsynch
Aug 12, 2019
Merged

Fix ConcurrentModificationException when iterating through connection#922
marci4 merged 1 commit into
TooTallNate:masterfrom
hovis:connectionsynch

Conversation

@hovis
Copy link
Copy Markdown
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.

2 participants