Skip to content

Commit

Permalink
GEODE-1607: Fix ConcurrentModificationException during cache close
Browse files Browse the repository at this point in the history
  • Loading branch information
pivotal-eshu committed Jun 30, 2016
1 parent ee05774 commit 186a09a
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -583,8 +583,15 @@ public void close() {
if (isClosed()) {
return;
}
this.closed = true;
for (TXStateProxy proxy: this.hostedTXStates.values()) {
TXStateProxy[] proxies = null;
synchronized (this.hostedTXStates) {
//After this, newly added TXStateProxy would not operate on the TXState.
this.closed = true;

proxies = this.hostedTXStates.values().toArray(new TXStateProxy[this.hostedTXStates.size()]);
}

for (TXStateProxy proxy: proxies) {
proxy.getLock().lock();
try {
proxy.close();
Expand Down

0 comments on commit 186a09a

Please sign in to comment.