Skip to content

Commit 8b5deea

Browse files
committed
#10519 do not close the flusher to avoid an ISE when iterating it during idle timeout
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
1 parent a8a8c8b commit 8b5deea

File tree

1 file changed

+9
-21
lines changed
  • jetty-quic/quic-common/src/main/java/org/eclipse/jetty/quic/common

1 file changed

+9
-21
lines changed

jetty-quic/quic-common/src/main/java/org/eclipse/jetty/quic/common/QuicSession.java

+9-21
Original file line numberDiff line numberDiff line change
@@ -401,25 +401,15 @@ public void outwardClose(long error, String reason)
401401
if (LOG.isDebugEnabled())
402402
LOG.debug("outward closing 0x{}/{} on {}", Long.toHexString(error), reason, this);
403403
quicheConnection.close(error, reason);
404-
try
405-
{
406-
// Flushing will eventually forward the outward close to the connection.
407-
flush();
408-
}
409-
catch (IllegalStateException ise)
410-
{
411-
// Flusher already is in CLOSED state, nothing else to do.
412-
if (LOG.isDebugEnabled())
413-
LOG.debug("IllegalStateException caught while flushing, flusher={} {}", flusher, this, ise);
414-
}
404+
// Flushing will eventually forward the outward close to the connection.
405+
flush();
415406
}
416407

417408
private void finishOutwardClose(Throwable failure)
418409
{
419410
try
420411
{
421412
endPoints.clear();
422-
flusher.close();
423413
getQuicConnection().outwardClose(this, failure);
424414
}
425415
finally
@@ -464,13 +454,6 @@ public void onTimeoutExpired()
464454
};
465455
}
466456

467-
@Override
468-
public void close()
469-
{
470-
super.close();
471-
timeout.destroy();
472-
}
473-
474457
@Override
475458
protected Action process() throws IOException
476459
{
@@ -523,17 +506,22 @@ protected void onCompleteSuccess()
523506
{
524507
if (LOG.isDebugEnabled())
525508
LOG.debug("connection closed {}", QuicSession.this);
526-
byteBufferPool.release(cipherBuffer);
527-
finishOutwardClose(new ClosedChannelException());
509+
finish(new ClosedChannelException());
528510
}
529511

530512
@Override
531513
protected void onCompleteFailure(Throwable failure)
532514
{
533515
if (LOG.isDebugEnabled())
534516
LOG.debug("failed to write cipher bytes, closing session on {}", QuicSession.this, failure);
517+
finish(failure);
518+
}
519+
520+
private void finish(Throwable failure)
521+
{
535522
byteBufferPool.release(cipherBuffer);
536523
finishOutwardClose(failure);
524+
timeout.destroy();
537525
}
538526
}
539527

0 commit comments

Comments
 (0)