poisonQueue(pending, cause);
}
- final void setForwarder(final ReconnectForwarder forwarder, final long now) {
+ final void setForwarder(final ReconnectForwarder forwarder) {
Verify.verify(successor == null, "Successor {} already set on connection {}", successor, this);
- successor = Preconditions.checkNotNull(forwarder);
- LOG.debug("Connection {} superseded by {}, splicing queue", this, successor);
-
- ConnectionEntry entry = inflight.poll();
- while (entry != null) {
- successor.forwardEntry(entry, now);
- entry = inflight.poll();
- }
+ Verify.verify(inflight.isEmpty(), "In-flight requests after replay: %s", inflight);
+ Verify.verify(pending.isEmpty(), "Pending requests after replay: %s", pending);
- entry = pending.poll();
- while (entry != null) {
- successor.forwardEntry(entry, now);
- entry = pending.poll();
- }
+ successor = Preconditions.checkNotNull(forwarder);
+ LOG.debug("Connection {} superseded by {}", this, successor);
}
final void remove(final long now) {