After a while (when an output buffer reach upper bound),
BGP's ChannelOutputLimiter handler get stacked waiting for the channel to become writable again.
The writability change never happen, however socket flush is invoked,
so the session peer dies on holdtimer expiration.
Looks like calling #flush when writability changes to non-writable has no effect.
Invoking #flush in #ensureWritable makes the expected action.
Change-Id: I95681d87c30aff82ec360a2d13fc01fe35873507
Signed-off-by: Milos Fabian <milfabia@cisco.com>
while (this.blocked) {
try {
LOG.debug("Waiting for session {} to become writable", this.session);
+ flush();
this.wait();
} catch (final InterruptedException e) {
throw new IllegalStateException("Interrupted while waiting for channel to come back", e);
LOG.debug("Writes on session {} {}", this.session, w ? "unblocked" : "blocked");
if (w) {
- this.notifyAll();
- } else {
- flush();
+ notifyAll();
}
}
public void channelInactive(final ChannelHandlerContext ctx) throws Exception {
synchronized (this) {
this.blocked = false;
- this.notifyAll();
+ notifyAll();
}
super.channelInactive(ctx);