NTCP: Log and fail messages on outbound queue overflow

This commit is contained in:
zzz
2018-06-17 16:00:17 +00:00
parent 8eb6dc0aef
commit d500f61738

View File

@@ -471,7 +471,12 @@ public class NTCPConnection implements Closeable {
* toss the message onto the connection's send queue
*/
public void send(OutNetMessage msg) {
_outbound.offer(msg);
if (!_outbound.offer(msg)) {
if (_log.shouldWarn())
_log.warn("outbound queue full on " + this + ", dropping message " + msg);
_transport.afterSend(msg, false, false, msg.getLifetime());
return;
}
boolean noOutbound = (getCurrentOutbound() == null);
if (isEstablished() && noOutbound)
_transport.getWriter().wantsWrite(this, "enqueued");