Why does the user agent resubmit the request after the server performs a TCP reset?

We recently noticed a problem where some user agents repeated the same POST request without actually physically launching its user twice.

After further study, we noticed that this only happens when the request passes through our load balancer, and when the server takes a long time to process the request. The packet capture session ultimately showed that the load balancer disconnects the connection after a 5-minute timeout by sending a TCP Reset to the client; however, the client automatically resubmitted the request without user intervention.

We observed this behavior in the Apache HTTP client for Java, Firefox, and IE 8. (I cannot install other browsers for testing.) This makes me think that this behavior is part of the HTTP standard, but it is not so simple for Google.

Also, it seems that this only happens if the first request is sent over a supported TCP connection.

+7
tcp user-agent
source share
1 answer

This is part of the HTTP 1.1 protocol for handling connections that are prematurely closed by servers.

http://www.w3.org/Protocols/rfc2616/rfc2616-sec8.html#sec8.2.4 .

I experienced a similar situation when we got the same form placed a couple of times in milliseconds.

The capture packet through wirehark confirmed the retransmission by the browser, and the logs from the server indicated the arrival of requests.

In addition, further research also showed that a load balancer such as the F5 reported a frequency of retransmission behavior. Therefore, it is also worth checking with your supplier of load balancing.

+5
source share

All Articles