Skip to content

Commit

Permalink
HBASE-24074 ConcurrentModificationException occured in ReplicationSou…
Browse files Browse the repository at this point in the history
…rceManager while refreshing the peer (apache#1471)

Signed-off-by: Huaxiang Sun <[email protected]>
Signed-off-by: stack <[email protected]>
  • Loading branch information
pankaj72981 authored and thangTang committed Apr 16, 2020
1 parent c28eb5b commit 368f446
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -496,11 +496,13 @@ public void refreshSources(String peerId) throws IOException {
// synchronized on oldsources to avoid race with NodeFailoverWorker
synchronized (this.oldsources) {
List<String> previousQueueIds = new ArrayList<>();
for (ReplicationSourceInterface oldSource : this.oldsources) {
for (Iterator<ReplicationSourceInterface> iter = this.oldsources.iterator(); iter
.hasNext();) {
ReplicationSourceInterface oldSource = iter.next();
if (oldSource.getPeerId().equals(peerId)) {
previousQueueIds.add(oldSource.getQueueId());
oldSource.terminate(terminateMessage);
this.oldsources.remove(oldSource);
iter.remove();
}
}
for (String queueId : previousQueueIds) {
Expand Down

0 comments on commit 368f446

Please sign in to comment.