Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 337898 - Connections closed too early thinking they are idle
Summary: Connections closed too early thinking they are idle
Status: RESOLVED FIXED
Alias: None
Product: Jetty
Classification: RT
Component: server (show other bugs)
Version: 7.3.0   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 7.3.x   Edit
Assignee: Simone Bordet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-22 15:53 EST by Simone Bordet CLA
Modified: 2011-02-22 19:19 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Simone Bordet CLA 2011-02-22 15:53:25 EST
Test case TimeoutExchangeTest.testExchangeTimeoutNotExpiring() fails spuriously due to the fact that the client closes the connection too early if the server takes time to process the request, thinking that the connection is idle when instead it's waiting for a response.

Needs investigation, but it looks like in SelectChannelEndPoint.checkIdleTimestamp() the value of _maxIdleTime is set to HttpClient.timeout (so could be a small value) that could trigger the call to idleExpired(). It is wrong that the maxIdleTime is set to the timeout.
Comment 1 Greg Wilkins CLA 2011-02-22 16:34:36 EST
I don't think this is an error.

The maxIdleTime is set from the soTimeout, which is set from the exchange timeout.   The connection cannot be idle for longer than the total exchange time, so I think it is just that the 500 in the test harness is too short.

I've set it to 2000 for now and it does not fail.

Reopen if you disagree
Comment 2 Greg Wilkins CLA 2011-02-22 18:10:33 EST
ooops - the problem is that an individual exchange timeout should overrule the HttpClient set timeout.
Comment 3 Greg Wilkins CLA 2011-02-22 19:19:42 EST
Updated HttpConnection to look for exchange timeouts different to httpClient timeout, and if so, set the endp maxIdleTime while the exchange is associated with the endp.