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%2FConnectingClientConnection.java;h=07ef7695448e5d3933510f3745ef3729e09f7fb8;hb=80e6514d56cd4dc6aa40997dea2b460723148341;hp=cdadf1d6012dee2e85dae1a0e41f93c31e0e6aea;hpb=320a4e5cd2d9d80468a3f82798744f2035488218;p=controller.git diff --git a/opendaylight/md-sal/cds-access-client/src/main/java/org/opendaylight/controller/cluster/access/client/ConnectingClientConnection.java b/opendaylight/md-sal/cds-access-client/src/main/java/org/opendaylight/controller/cluster/access/client/ConnectingClientConnection.java index cdadf1d601..07ef769544 100644 --- a/opendaylight/md-sal/cds-access-client/src/main/java/org/opendaylight/controller/cluster/access/client/ConnectingClientConnection.java +++ b/opendaylight/md-sal/cds-access-client/src/main/java/org/opendaylight/controller/cluster/access/client/ConnectingClientConnection.java @@ -9,17 +9,20 @@ package org.opendaylight.controller.cluster.access.client; import com.google.common.annotations.Beta; import java.util.Optional; -import org.opendaylight.controller.cluster.access.concepts.ResponseEnvelope; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; +import org.opendaylight.controller.cluster.access.concepts.RequestException; @Beta public final class ConnectingClientConnection extends AbstractClientConnection { - private static final Logger LOG = LoggerFactory.getLogger(ConnectingClientConnection.class); + /** + * A wild estimate on how deep a queue should be. Without having knowledge of the remote actor we can only + * guess its processing capabilities while we are doing initial buffering. With {@link AveragingProgressTracker} + * this boils down to a burst of up to 2000 messages before we start throttling. + */ + private static final int TARGET_QUEUE_DEPTH = 4000; // Initial state, never instantiated externally ConnectingClientConnection(final ClientActorContext context, final Long cookie) { - super(context, cookie); + super(context, cookie, new TransmitQueue.Halted(TARGET_QUEUE_DEPTH)); } @Override @@ -28,12 +31,13 @@ public final class ConnectingClientConnection extends Abs } @Override - void receiveResponse(final ResponseEnvelope envelope) { - LOG.warn("Initial connection {} ignoring response {}", this, envelope); + long backendSilentTicks(final long now) { + // We are still connecting and do not want the timer to attempt a reconnect + return 0; } @Override - ClientActorBehavior reconnectConnection(final ClientActorBehavior current) { - throw new UnsupportedOperationException("Attempted to reconnect a connecting connection"); + ClientActorBehavior lockedReconnect(final ClientActorBehavior current, final RequestException cause) { + throw new UnsupportedOperationException("Attempted to reconnect a connecting connection", cause); } }