Fix potential issue with transaction timeouts 62/14662/4
authortpantelis <tpanteli@brocade.com>
Sat, 31 Jan 2015 04:52:15 +0000 (23:52 -0500)
committertpantelis <tpanteli@brocade.com>
Tue, 3 Feb 2015 05:11:47 +0000 (00:11 -0500)
commite21222785a8a4de25c2e59e883e288f4db84451e
treeba59ce740f192b9a50b6b73b952a8285b4234234
parent2c18b1c5c2f37e620883f308b2a1271616889add
Fix potential issue with transaction timeouts

If CanCommit is sent for a transaction but there is already a current
transaction being committed, the second transaction is queued and
processed when the current transaction completes. However when the
second transaction is de-queued and CanComitted, the last access time
is not updated. There is a periodic timer task that checks if the current
transaction has not been accessed after a relatively long period of time
(eg if CanCommit was sent but Commit isn't sent possibly due to network
failure). In this case the current transaction is aborted. So if a
transaction was queued for a long enough period of time, when it becomes
the current transaction, the timer task could run and abort it before
the front-end has a chance to send the Commit. To prevent this, the
de-queued transaction's access time is updated when it it made the
current transaction.

I also changed the commit() and preCommit() calls to the InMemoryDataStore
to catch Exception as the InMemoryDataStore can throw unchecked
exceptions. If uncaught, the exception is propagated to akka and no
response is sent.

Change-Id: I516bde86f45272f2d40fab76acbc27180e2ad402
Signed-off-by: tpantelis <tpanteli@brocade.com>
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/Shard.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/ShardCommitCoordinator.java