Uploaded image for project: 'HttpComponents HttpClient'
  1. HttpComponents HttpClient
  2. HTTPCLIENT-2028

Restore staleConnectionCheckEnabled=true semantic behavior in validateAfterInactivity config

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Duplicate
    • 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
    • None
    • HttpClient (classic)
    • None

    Description

      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!

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              pfrank13 Peter Frank
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m