You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by "Peter Frank (Jira)" <ji...@apache.org> on 2019/11/08 15:56:00 UTC
[jira] [Comment Edited] (HTTPCLIENT-2028) Restore
staleConnectionCheckEnabled=true semantic behavior in
validateAfterInactivity config
[ https://issues.apache.org/jira/browse/HTTPCLIENT-2028?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16970344#comment-16970344 ]
Peter Frank edited comment on HTTPCLIENT-2028 at 11/8/19 3:55 PM:
------------------------------------------------------------------
To me validation queries to SQL servers in JDBC is the same as a stale check to Http but I guess that assumption is inaccurate. I mean obviously this is anecdotal but in all my years of working with wiremock and HttpClient 3.x till 4.5 I never experienced this issue (which I think was setStaleConnectionCheckedEnabled=true by default), but maybe I've just been lucky. So failing that what would you suggest as a workaround, is there a retry mechanism on stale connection that can be used?
was (Author: pfrank13):
To me validation queries to SQL servers in JDBC is the same as a stale check to Http but I guess that assumption is inaccurate. I mean obviously this is anecdotal but in all my years of working with wiremock and HttpClient 3.x till 4.5 I never experienced this issue, but maybe I've just been lucky. So failing that what would you suggest as a workaround, is there a retry mechanism on stale connection that can be used?
> 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: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org