[
https://issues.apache.org/jira/browse/HTTPCLIENT-2028?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16970416#comment-16970416
]
Peter Frank commented on HTTPCLIENT-2028:
-----------------------------------------
>I am not sure why you are saying connection validation has been removed in 5.0
>cause as far as I can see it is still there
Yes but the semantic of staleConnectionCheckEnabled=true (e.g. check all the
time) is not, as you can only go as low as 1 millis, 0 disables the check
altogether. My PR in the HTTP CORE ticket brings the check back.
WRT
>Connection life-time control and proactive eviction of expired connection is
>way, way preferred to the stale connection check and request re-execution.
As I understood that, isn't that a thread that periodically checks for expired
connections, I think that wouldn't actually solve my problem as it would just
be luck of the draw if the evicting thread ran or not in time. My main problem
is things are being torn down and set up extremely quickly, thread scheduling
latency alone may make that a non viable solution.
> Restore staleConnectionCheckEnabled=true semantic behavior in
> validateAfterInactivity config
> --------------------------------------------------------------------------------------------
>
> Key: HTTPCLIENT-2028
> URL: https://issues.apache.org/jira/browse/HTTPCLIENT-2028
> Project: HttpComponents HttpClient
> Issue Type: Improvement
> Components: HttpClient (classic)
> Affects Versions: 4.5, 4.5.1, 4.5.2, 4.5.3, 4.5.4, 4.5.5, 4.5.6, 4.5.7,
> 4.5.8, 4.5.9, 4.5.10
> Reporter: Peter Frank
> Priority: Major
>
> Between HttpClient 4.4.x and 4.5.x setStaleConnectionCheckEnabled was
> deprecated in favor of setValidateAfterInactivity. That's all fine, however,
> the implementation of setValidateAfterInactivity has no ability to check if a
> connection is stale all the time. The closest one can get is 1 ms, and
> that's unfortunately not short enough in a test environment scenario when a
> test Http Server is being restarted between Tests to clear out state.
> This is a common issue on the internet for people that use something like
> Wiremock, the irony is troubleshooting the situation makes it go away (cause
> logging slows the tests).
> I would suggest making 0 a special value to "turn on" validation all the time.
> With HttpClient 5 removing the old staleConnectionCheckEnabled completely
> with a piece of what that feature actually did also being removed I fear it
> will leave me, and perhaps others, in a bit of a lurch. Thanks!
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]