Repository navigation
Description
Jetty version(s)
Jetty 12.1.x
Jetty Environment
Jetty core http2
HTTP version
HTTP2
Java version/vendor (use: java -version)
openjdk version "25.0.1" 2025-10-21 LTS
OpenJDK Runtime Environment Corretto-25.0.1.8.1 (build 25.0.1+8-LTS)
OpenJDK 64-Bit Server VM Corretto-25.0.1.8.1 (build 25.0.1+8-LTS, mixed mode, sharing)
OS type/version
Darwin macOS 26.5.2
Description
Disclaimer: this report was 100% human generated. The analysis was 100% human.
There seems to be a race condition and potentially a bug in the way idle timeout on http2 streams is handled.
The first issue is a race condition:
- is being called from another thread than the on calling
Line 357 in 0423c45
notIdle(); Line 346 in 0423c45
protected void onIdleTimeout(TimeoutException timeout) - Therefore is not updated
jetty.project/jetty-core/jetty-io/src/main/java/org/eclipse/jetty/io/CyclicTimeouts.java
Line 121 in 0423c45
long newExpiresAt = expirable.getExpireNanoTime(); - therefore is false.
jetty.project/jetty-core/jetty-io/src/main/java/org/eclipse/jetty/io/CyclicTimeouts.java
Line 130 in 0423c45
if (earliest != Long.MAX_VALUE) - The timeout is never rescheduled.
Second issue: idle timeout called twice on the same stream. Here are the steps:
- is true
Line 411 in 0423c45
requestHandled = _handling != null || _handled; - is returned with requestHandled set to true
Line 461 in 0423c45
return new IdleTimeoutTask(onFailure(t), requestHandled); - is being called with
Line 610 in 0423c45
consumer.accept(task.action(), !task.handlingRequest()); !task.handlingRequest()to false - is false
- is called
- has a new value
jetty.project/jetty-core/jetty-io/src/main/java/org/eclipse/jetty/io/CyclicTimeouts.java
Line 121 in 0423c45
long newExpiresAt = expirable.getExpireNanoTime(); - is called
jetty.project/jetty-core/jetty-io/src/main/java/org/eclipse/jetty/io/CyclicTimeouts.java
Line 131 in 0423c45
schedule(now + earliest);
How to reproduce?
See hypnoce@08bf130
Let me know if this issues needs more clarification. The 2 provided tests can help.
Metadata
Metadata
Labels
Type
Projects
- StatusShow more project fieldsβ Done
- StatusShow more project fieldsβ Done
Activity
lorban commentedon Aug 24, 2026
@hypnoce sorry for the delay getting back to you.
About the first issue, this is indeed a bug and the test you provided elegantly reproduces it. I've fixed it here so you can try out the fix yourself if you wish. If you did, we'd be glad if you could post your feedback here. Please keep in mind that this same bug may affect other places (almost certainly H3, possibly other things too) so the PR currently is incomplete although H2 should be sorted.
About the second issue, I'm not sure this is a problem at all, and even so, your test does not reproduce it as it passes without any modification. Have I missed something?
Thanks!
7 remaining items
lorban commentedon Sep 24, 2026
Needs to be backported to 12.0.x before it can be closed.
12.0.x: Fix idle timeout rescheduling (#15386)