Bug 215631
Summary: | Webkit incorrectly reuses closed tcp connections: Failed to load resource: The network connection was lost. | ||
---|---|---|---|
Product: | WebKit | Reporter: | kevmun |
Component: | WebCore JavaScript | Assignee: | Nobody <webkit-unassigned> |
Status: | NEW | ||
Severity: | Critical | CC: | ap, webkit-bug-importer, youennf |
Priority: | P2 | Keywords: | InRadar |
Version: | Safari 13 | ||
Hardware: | Mac | ||
OS: | macOS 10.15 |
kevmun
In our webapp using webkit, we see an issue with certain AJAX requests, "Failed to load resource: The network connection was lost."
We have observed that using Fetch (https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API) we hit a timing issue where the browser tries to reuse a connection that was recently closed. With optimal network conditions, it’s about a 2% chance of this occurring. With high latency packets, we can reproduce %15 of the time.
Steps to repro:
Navigate at exactly 7 seconds (when our server terminates the connection, reproducing outside this environment will depend on the server timeouts).
We've observed our TCP connections to be in TIME_WAIT at the time of failure;
The docs here refer to webkit keeping connections open
https://developer.apple.com/library/archive/documentation/NetworkingInternetWeb/Conceptual/NetworkingOverview/CommonPitfalls/CommonPitfalls.html
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/67385261>
Alexey Proskuryakov
> Navigate at exactly 7 seconds (when our server terminates the connection, reproducing outside this environment will depend on the server timeouts).
Can you share the server URL?
Alexey Proskuryakov
As a workaround, can you use HTTP/2 instead instead of HTTP/1 or add `Keep-Alive: timeout=7` header?