You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Java11 Http2Client rejects documented zero connect and read timeouts #3635
Request.Options.connectTimeoutMillis() and readTimeoutMillis() document 0 as no timeout, but the Java11 client passes zero durations directly to the JDK builders, which reject them.
On current master (fee42b4), a request with a zero read timeout throws IllegalArgumentException: Invalid duration: PT0S before being sent. A zero connect timeout also makes new Http2Client(options) fail. The same problem affects the synchronous and asynchronous execution paths, including a supplied native client with no connect timeout configured.
I reproduced this with the public Http2Client.execute methods against a local MockWebServer, using real Zulu 11.0.32.1 compilation and Temurin 25 test execution as required by the module's toolchains. Seven zero-timeout cases fail with IllegalArgumentException; both positive-timeout controls receive the expected HTTP response.
For example:
Optionsoptions = newOptions(5000, TimeUnit.MILLISECONDS, 0, TimeUnit.MILLISECONDS, true);
Http2Clientclient = newHttp2Client(options);
client.execute(request, options); // fails before sending the request
I am preparing a fix to omit the relevant JDK timeout setter for zero, and to treat an absent native connect timeout as matching zero. Positive timeout behavior and rejection of negative values will remain unchanged. This is separate from #3068's streaming response-body timeout question.
Activity