Quantcast
Channel: HAProxy community - Latest topics
Viewing all articles
Browse latest Browse all 4849

Close client connection on backend TCP failure

$
0
0

Hello,

I’m setting up a file upload, but I have trouble closing connections when the backend restarts.

My current setup is HAProxy > Frankenphp (dockerized).

  • When I restart HAProxy, the client connection is closed as expected and receives a NS_ERROR_CONNECTION_REFUSED on Firefox :white_check_mark:

  • When I restart Franken, the client connection is not properly closed and the client keeps trying sending data :cross_mark:

I have to restart Franken sometimes during new deployments. I don’t mind interrupting client uploads, but I’d like to give them proper error messages.

Franken is restarted with docker compose up -d --force-recreate franken, so no graceful shutdown or Connection: close header sent by the server.

Here is my HAProxy 3.1 configuration:

defaults
    timeout connect 1s
    timeout client 30s
    timeout server 10s

frontend www
    bind :80
    mode http
    default_backend franken

backend franken
    mode http
    option httpchk GET /healthcheck.php
    http-check expect string OK
    option forwardfor except 127.0.0.1
    server franken1 franken:80 check

How to close the client connection, if the backend TCP connection fails and not closed properly?

I tried using http checks, but the restart can be very fast.

Any idea on this matter? Let me know if more context/logs/setup is needed.

Thanks by advance!

2 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 4849

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>