*From:* Marco Colli [mailto:collimarc...@gmail.com]
*Sent:* Friday, September 27, 2019, 07:21 EDT
*To:* HAProxy <haproxy@formilux.org>
*Subject:* How to wait some time before retry?

Still have this issue and I cannot find a solution. It would be great to have an option "wait time before retry" in the next versions of HAProxy (instead of the fixed value of 1 sec).

On Mon, Sep 16, 2019 at 2:03 PM Marco Colli <collimarc...@gmail.com <mailto:collimarc...@gmail.com>wrote:


    I have a question about HAProxy configuration. Maybe someone has a
    solution ;)

    I have a HAProxy (v2.0) load balancer in front of many web servers.

    When I restart the web servers the TCP socket remains closed for a
    few seconds (~10s). For this reason I would like to retry failed
    attempts to connect after some seconds.

    I already use |option redispatch|, however it seems that does not
    solve my issue. The problem is that the request is retried
    immediately (after 1s), thus causing all the retries to fail. From
    the HAProxy docs:

        In order to avoid immediate reconnections to a server which is
        restarting, a turn-around timer of min("timeout connect", one
        second) is applied before a retry occurs.

    Is there any option to wait some more time (e.g. 10s) before
    retrying? Or do you have any other solution?

Not the cleanest solution, but something that could work would be to add a lua action to sleep for 10 seconds on the response when you have a connect error, and then override the response to a 307 (or perhaps 302) redirect back to the same location. This will then cause the browser to retry the request.


Reply via email to