Timeout in AJAX call issues request twice
Reported by
eric.and...@gmail.com,
Aug 5 2016
|
|||||
Issue descriptionChrome Version : 54.0.2820.2 URLs (if applicable) : https://github.com/ericandrewlewis/duplicate-ajax-request-in-the-browser/ Other browsers tested: Add OK or FAIL, along with the version, after other browsers where you have tested this issue: Safari: FAIL 9.1.1 Firefox: FAIL 46.0.1 IE: What steps will reproduce the problem? I've created a repository with a basic Node.js server to illustrate the problem: https://github.com/ericandrewlewis/duplicate-ajax-request-in-the-browser/ Clone this repository, run `node index.js`. Open a browser and load `http://localhost:3000`. Open DevTools and look at the Network pane, and compare it to the Node server's log. What is the expected result? Only one request is displayed in DevTools Network pane, so I would expect only one request received by the server. What happens instead? The server receives one HTTP request, and then a duplicate after 3 seconds. Please provide any additional information below. Attach a screenshot if possible. This may be related to HTTP/1.1 RFC 8.2.4 (http://stackoverflow.com/questions/14302512/what-happens-when-no-response-is-received-for-a-request-im-seeing-retries/14345476#14345476). I'm not sure Chromium's implementation is to spec. eg. An HTTP GET request does not include a request body. If this behavior is intentional, it would be useful to surface the fact that a duplicate request is sent to the user in the DevTools Network pane.
,
Aug 8 2016
No reason to believe that this is at all related to the HTTP layer (In fact, I can guarantee it isn't).
,
Aug 8 2016
Actually, looking at the screenshot, looks like the server is just hanging up on us after we send the request, on a re-used socket. We retry in that case, because there's no way to tell if the server timed out the idle socket around the same time we sent out the request, or if a weird server (Or a non-HTTP server) got our request, and just really didn't like it. Looks like it's the latter, in this case. The reconnect behavior is expected and necessary for us ever to be able to reuse sockets after any time has passed. So labeling as a devtools issue, to focus on the multiple requests not showing up on devtools.
,
Aug 9 2016
,
Jul 20 2017
,
Jul 26 2017
I'm just curious — why WontFix?
,
Jul 26 2017
In order to be able to ever reuse sockets, we have to retry when we reuse a socket and a server just hangs up on us without a response - it is reasonable for servers to timeout sockets, after all, and we can't rely on what timeout they use for this. That was the situation in the log. Unless we open a new socket for every request, which would destroy performance, we can't really do anything else. |
|||||
►
Sign in to add a comment |
|||||
Comment 1 by kavvaru@chromium.org
, Aug 8 2016Labels: M-54 TE-NeedsTriageHelp