X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fcds-access-client%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Faccess%2Fclient%2FAbstractClientConnection.java;h=32becc040d4b594cd5657889e9268ec8469597cf;hb=refs%2Fchanges%2F22%2F57822%2F3;hp=6cb89eec1601e5fa901f89e7ac37d7e254698d66;hpb=8fca604f2312ef365ce05343c2378cf36f2e31af;p=controller.git diff --git a/opendaylight/md-sal/cds-access-client/src/main/java/org/opendaylight/controller/cluster/access/client/AbstractClientConnection.java b/opendaylight/md-sal/cds-access-client/src/main/java/org/opendaylight/controller/cluster/access/client/AbstractClientConnection.java index 6cb89eec16..32becc040d 100644 --- a/opendaylight/md-sal/cds-access-client/src/main/java/org/opendaylight/controller/cluster/access/client/AbstractClientConnection.java +++ b/opendaylight/md-sal/cds-access-client/src/main/java/org/opendaylight/controller/cluster/access/client/AbstractClientConnection.java @@ -69,6 +69,9 @@ public abstract class AbstractClientConnection { @VisibleForTesting static final long NO_PROGRESS_TIMEOUT_NANOS = TimeUnit.MINUTES.toNanos(15); + // Emit a debug entry if we sleep for more that this amount + private static final long DEBUG_DELAY_NANOS = TimeUnit.MILLISECONDS.toNanos(100); + private final Lock lock = new ReentrantLock(); private final ClientActorContext context; @GuardedBy("lock") @@ -132,6 +135,9 @@ public abstract class AbstractClientConnection { final long now = currentTime(); final long delay = enqueueEntry(new ConnectionEntry(request, callback, now), now); try { + if (delay >= DEBUG_DELAY_NANOS && LOG.isDebugEnabled()) { + LOG.debug("Sleeping for {}ms", TimeUnit.NANOSECONDS.toMillis(delay)); + } TimeUnit.NANOSECONDS.sleep(delay); } catch (InterruptedException e) { Thread.currentThread().interrupt();