Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zero connection timeout is not supported in HTTP client with non-blocking connect #5150

Closed
olegmoz opened this issue Aug 13, 2020 · 1 comment · Fixed by #5151
Closed

Zero connection timeout is not supported in HTTP client with non-blocking connect #5150

olegmoz opened this issue Aug 13, 2020 · 1 comment · Fixed by #5151
Assignees

Comments

@olegmoz
Copy link
Contributor

olegmoz commented Aug 13, 2020

Jetty version: org.eclipse.jetty:jetty-client:9.4.30.v20200611
Java version: 1.8
OS: Windows 10

I am trying to set infinite connection timeout in HttpClient by setting it's connection timeout to zero value. The setting does makes connection timeout infinite in blocking mode (HttpClient.setConnectBlocking(true)) and makes connections fail with timeout exception in non-blocking mode (HttpClient.setConnectBlocking(true)).

Example:

HttpClient client = new HttpClient();
client.setConnectBlocking(false);
client.setConnectTimeout(0);
client.newRequest(...).send(); // fails with SocketTimeoutException()

The reason seems to be no special handling for zero value in ManagedSelector.Connect constructor, see https://github.com/eclipse/jetty.project/blob/jetty-10.0.x/jetty-io/src/main/java/org/eclipse/jetty/io/ManagedSelector.java#L892

olegmoz added a commit to olegmoz/jetty.project that referenced this issue Aug 13, 2020
olegmoz added a commit to olegmoz/jetty.project that referenced this issue Aug 13, 2020
olegmoz added a commit to olegmoz/jetty.project that referenced this issue Aug 13, 2020
Signed-off-by: Oleg Mozzhechkov <oleg.mozzhechkov@gmail.com>
@joakime joakime added this to To do in Jetty 9.4.32 via automation Aug 13, 2020
olegmoz added a commit to olegmoz/jetty.project that referenced this issue Aug 13, 2020
Signed-off-by: Oleg Mozzhechkov <oleg.mozzhechkov@gmail.com>
sbordet added a commit that referenced this issue Aug 14, 2020
Issue #5150 - Infinite connection timeout support in ManagedSelector
@sbordet
Copy link
Contributor

sbordet commented Aug 14, 2020

Fixed by #5151.

@sbordet sbordet closed this as completed Aug 14, 2020
Jetty 9.4.32 automation moved this from To do to Done Aug 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Jetty 9.4.32
  
Done
Development

Successfully merging a pull request may close this issue.

2 participants