X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fcds-access-client%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Faccess%2Fclient%2FAbstractClientConnection.java;h=c32f7b2532cbe2d259357f5219b15835f941096a;hp=7375fe06d95f3986860755b5066eb47f4e6bff8d;hb=refs%2Fchanges%2F10%2F78310%2F5;hpb=a8ebe8ce348c544635c996d8538af0ec9113d1b3 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 7375fe06d9..c32f7b2532 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 @@ -78,6 +78,7 @@ public abstract class AbstractClientConnection { @GuardedBy("lock") private final TransmitQueue queue; private final Long cookie; + private final String backendName; @GuardedBy("lock") private boolean haveTimer; @@ -90,9 +91,11 @@ public abstract class AbstractClientConnection { private volatile RequestException poisoned; // Private constructor to avoid code duplication. - private AbstractClientConnection(final AbstractClientConnection oldConn, final TransmitQueue newQueue) { + private AbstractClientConnection(final AbstractClientConnection oldConn, final TransmitQueue newQueue, + final String backendName) { this.context = Preconditions.checkNotNull(oldConn.context); this.cookie = Preconditions.checkNotNull(oldConn.cookie); + this.backendName = Preconditions.checkNotNull(backendName); this.queue = Preconditions.checkNotNull(newQueue); // Will be updated in finishReplay if needed. this.lastReceivedTicks = oldConn.lastReceivedTicks; @@ -100,9 +103,11 @@ public abstract class AbstractClientConnection { // This constructor is only to be called by ConnectingClientConnection constructor. // Do not allow subclassing outside of this package - AbstractClientConnection(final ClientActorContext context, final Long cookie, final int queueDepth) { + AbstractClientConnection(final ClientActorContext context, final Long cookie, final String backendName, + final int queueDepth) { this.context = Preconditions.checkNotNull(context); this.cookie = Preconditions.checkNotNull(cookie); + this.backendName = Preconditions.checkNotNull(backendName); this.queue = new TransmitQueue.Halted(queueDepth); this.lastReceivedTicks = currentTime(); } @@ -110,14 +115,15 @@ public abstract class AbstractClientConnection { // This constructor is only to be called (indirectly) by ReconnectingClientConnection constructor. // Do not allow subclassing outside of this package AbstractClientConnection(final AbstractClientConnection oldConn) { - this(oldConn, new TransmitQueue.Halted(oldConn.queue, oldConn.currentTime())); + this(oldConn, new TransmitQueue.Halted(oldConn.queue, oldConn.currentTime()), oldConn.backendName); } // This constructor is only to be called (indirectly) by ConnectedClientConnection constructor. // Do not allow subclassing outside of this package - AbstractClientConnection(final AbstractClientConnection oldConn, final T newBackend, final int queueDepth) { + AbstractClientConnection(final AbstractClientConnection oldConn, final T newBackend, + final int queueDepth) { this(oldConn, new TransmitQueue.Transmitting(oldConn.queue, queueDepth, newBackend, oldConn.currentTime(), - Preconditions.checkNotNull(oldConn.context).messageSlicer())); + Preconditions.checkNotNull(oldConn.context).messageSlicer()), newBackend.getName()); } public final ClientActorContext context() { @@ -422,7 +428,8 @@ public abstract class AbstractClientConnection { context.executeInActor(current -> { final double time = beenOpen * 1.0 / 1_000_000_000; entry.complete(entry.getRequest().toRequestFailure( - new RequestTimeoutException(entry.getRequest() + " timed out after " + time + " seconds"))); + new RequestTimeoutException(entry.getRequest() + " timed out after " + time + + " seconds. The backend for " + backendName + " is not available."))); return current; }); }