From: tpantelis Date: Fri, 23 Jan 2015 09:44:07 +0000 (-0500) Subject: Bug 2650: Fix ConcurrentModificationEx in TransactionProxy X-Git-Tag: release/lithium~647 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=commitdiff_plain;h=166c432bc0611288abf2e13ef8f184cfbb2c101a;hp=166c432bc0611288abf2e13ef8f184cfbb2c101a;ds=sidebyside Bug 2650: Fix ConcurrentModificationEx in TransactionProxy There were a couple patches proposed by other folks. Gary's patch https://git.opendaylight.org/gerrit/#/c/14577/ to use a BlockingQueue would work and is slightly simpler code but I prefer to avoid the unneeded synchronization overhead that BlockingQueue carries as we still need explicit synchronization for atomic access to txOperationsOnComplete and transactionContext. I implemented something similar to Robert's propopsal in https://git.opendaylight.org/gerrit/#/c/14565/ . I added a unit test that does a transaction put after an async read but unfortunately it didn't reproduce the issue due to the behavior of the akka dispatcher in the unit tests. The read future callback is batched by the dispatcher even when using the CallingThreadDispatcher so the synchronous read callback isn't achieved. Somehow the threading behavior is different in the producton system. Regardless I kept the unit test anyway - better than not haviing it. Change-Id: I70f4e2507411c63cff99d03bf046c65e78a8138e Signed-off-by: tpantelis ---