[jira] [Created] (HTTPCLIENT-2015) Connect timeout value is effective doubled

2019-09-11 Thread Chanseok Oh (Jira)
Chanseok Oh created HTTPCLIENT-2015:
---

 Summary: Connect timeout value is effective doubled
 Key: HTTPCLIENT-2015
 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-2015
 Project: HttpComponents HttpClient
  Issue Type: Bug
  Components: HttpClient (classic)
Affects Versions: 4.5.10
 Environment: Debian-based Linux

openjdk version "1.8.0_222"
OpenJDK Runtime Environment (build 1.8.0_222-8u222-b10-1-b10)
OpenJDK 64-Bit Server VM (build 25.222-b10, mixed mode)
Reporter: Chanseok Oh


The connection times out, say, after 6 seconds when calling 
`setConnectionTimeout(3000)`. The timeout value is effectively doubled. I've 
provided sample code, which demonstrates that the JDK Socket times out after 3 
seconds, but the Apache HTTP Client times out after 6 seconds.

This may seem like a minor bug to others, but our product functionality depends 
on timeouts in part and allows the user to adjust the timeouts, and this 
timeout-doubling-effect is causing some trouble to us.

{code:java}
  public static void main(String[] args) {
long started = System.nanoTime();
try (Socket socket = new Socket()) {
  socket.connect(new InetSocketAddress("example.com", 81), 3000);
} catch (IOException ex) {
  ex.printStackTrace(System.out);
} finally {
  System.out.println("JDK elapsed (s): " + (System.nanoTime() - started) / 
10L);
}

try (CloseableHttpClient client = HttpClients.createDefault()) {
  HttpGet httpGet = new HttpGet("https://example.com:81;);
  httpGet.setConfig(RequestConfig.custom().setConnectTimeout(3000).build());
  long started2 = System.nanoTime();
  try (CloseableHttpResponse res = client.execute(httpGet)) {
  } finally {
System.out.println("Apache elapsed (s): " + (System.nanoTime() - 
started2) / 10L);
  }
} catch (IOException ex) {
  ex.printStackTrace(System.out);
}
  }
{code}
 



--
This message was sent by Atlassian Jira
(v8.3.2#803003)

-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[GitHub] [httpcomponents-core] ok2c commented on issue #148: HTTPCORE-599

2019-09-11 Thread GitBox
ok2c commented on issue #148: HTTPCORE-599
URL: 
https://github.com/apache/httpcomponents-core/pull/148#issuecomment-530394030
 
 
   @rschmitt Half-closed connections should not be problem but TCP RST indeed 
might. I am now very tempted to start a major rewrite of the buffering logic in 
the TLS/SSL layer 


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org