The scenario is as below:
- There is an http reverse proxy, that has a pool of persistent connections with the application server. It has received a request from client and makes the same request to backend after checking that the connection is open
- Meanwhile, the server closes the connection before receiving the request, and the proxy fails with error reading from backend.
- An error is sent to the client.
How should this race condition be handled: - All connection close should be initiated by proxy and never by the backend server? - Proxy should retry request when it fails to send because of connection close?