Move OperationLimiter.acquire() warnings to callers 00/70200/1
authorRobert Varga <robert.varga@pantheon.tech>
Tue, 23 Jan 2018 16:42:44 +0000 (17:42 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Thu, 29 Mar 2018 21:46:57 +0000 (23:46 +0200)
commit621482f62c83ca4e53468bf3f61656628862cc8c
tree4dbd7145c74ff2b63a9ad935bbd96cfb9477370d
parent73b138d9a09d44a760c92a64a53164a2fa6618f5
Move OperationLimiter.acquire() warnings to callers

We have two distinct call sites from where we are acquiring permits,
where failure to acquire has different root cause:
RemoteTransactionContext's failure to acquire indicates a slow leader,
while TransactionContextWrapper indicates a failure to discover a leader
in time.

Modify acquire() to report success and log failures to acquire from
the two call sites, with different messages so it is immediately clear
what is going on.

Change-Id: Ie828984c6a984690224494af1a9fdd0e4f257fab
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 6a0fab98dc4d16a52922c6594f99a97d4050e800)
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/OperationLimiter.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/RemoteTransactionContext.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/TransactionContextWrapper.java
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/TransactionContextWrapperTest.java