Bug 2650: Fix ConcurrentModificationEx in TransactionProxy 91/14591/3
authortpantelis <tpanteli@brocade.com>
Fri, 23 Jan 2015 09:44:07 +0000 (04:44 -0500)
committertpantelis <tpanteli@brocade.com>
Thu, 29 Jan 2015 03:50:42 +0000 (22:50 -0500)
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 <tpanteli@brocade.com>

No differences found