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: :white_check_mark:]()
-
When I restart Franken, the client connection is not properly closed and the client keeps trying sending data
![:cross_mark: :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

