BUG-8403: guard against ConcurrentModificationException
[controller.git] / opendaylight / md-sal / cds-access-client / src / main / java / org / opendaylight / controller / cluster / access / client / ConnectingClientConnection.java
index 64867e1c0e22be7b6cbba40e7f894d6993f2d1ce..12c520bb17f2af39bbb845660eda161a03ba1585 100644 (file)
@@ -12,9 +12,16 @@ import java.util.Optional;
 
 @Beta
 public final class ConnectingClientConnection<T extends BackendInfo> extends AbstractClientConnection<T> {
+    /**
+     * 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, new TransmitQueue.Halted());
+        super(context, cookie, new TransmitQueue.Halted(TARGET_QUEUE_DEPTH));
     }
 
     @Override
@@ -23,7 +30,7 @@ public final class ConnectingClientConnection<T extends BackendInfo> extends Abs
     }
 
     @Override
-    ClientActorBehavior<T> reconnectConnection(final ClientActorBehavior<T> current) {
+    ClientActorBehavior<T> lockedReconnect(final ClientActorBehavior<T> current) {
         throw new UnsupportedOperationException("Attempted to reconnect a connecting connection");
     }
 }