BUG 3249 : Operation Limiter not release on completion of operation 98/20698/2
authorMoiz Raja <moraja@cisco.com>
Mon, 18 May 2015 21:12:08 +0000 (14:12 -0700)
committerGerrit Code Review <gerrit@opendaylight.org>
Tue, 19 May 2015 09:57:42 +0000 (09:57 +0000)
commit95538aa1baf80a90f03e4ae6d8268c9db34b3bfa
treec1996ab36aeae31370310b6a9c18532b9dd905b5
parent6507cb2ef462897379d9b8a8462e0899196188e0
BUG 3249 : Operation Limiter not release on completion of operation

The OperationLimiter uses up one permit and per operation done on a
transaction. When that operation is complete the permit must be
released. For Local transactions this was not happening. Due to this
when a local transaction has more operations than the maximum outstanding
operations we would block for the operation timeout period (5 seconds
by default) this can have all sorts of adverse side effects on
transactions.

This patch ensures that for local transactions those permits are freed
up when the operation is complete.

Change-Id: Id8ba99c6ea081c7e37da0b517860dca818a91218
Signed-off-by: Moiz Raja <moraja@cisco.com>
(cherry picked from commit 7deb48eedb9aec8230c65237c48679ecca6af919)
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/AbstractTransactionContextFactory.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/LocalTransactionContext.java
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/LocalTransactionContextTest.java [new file with mode: 0644]
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/TransactionProxyTest.java