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

Why is Retry around Redirect and not the other way round

    XMLWordPrintableJSON

Details

    Description

      I am wondering, why the ServiceUnavailableRetryExec is before the RedirectExec in the execChain of the the InternalHttpClient. I am referring to the HttpClientBuilder.build() method where the execChain is put together something like this:

      Client -> ... -> ServiceUnavailableRetryExec -> RedirectExec -> ...

      We have the following scenario, where this causes an unexpected behavior and changing the order would solve this:

      1. We are sending a request to endpoint A which returns a 303 with the endpoint B in the location-header
      2. The RedirectExec redirects the request to B what returns a 503
      3. Now the ServiceUnavailableRetryExec is doing its thing but retries to endpoint A

      I would expect the behavior of the client to retry to endpoint B instead of A. Is there a reason why the chain is implemented this way around or is this a "bug".

      Any help very appreciated!

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              nstaeger Nicolai Stäger
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: