<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>215631</bug_id>
          
          <creation_ts>2020-08-18 16:47:27 -0700</creation_ts>
          <short_desc>Webkit incorrectly reuses closed tcp connections: Failed to load resource: The network connection was lost.</short_desc>
          <delta_ts>2025-11-19 16:52:14 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebCore JavaScript</component>
          <version>Safari 13</version>
          <rep_platform>Mac</rep_platform>
          <op_sys>macOS 10.15</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Critical</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>kevmun</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ap</cc>
    
    <cc>joseph.belmonte</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>youennf</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1681242</commentid>
    <comment_count>0</comment_count>
    <who name="">kevmun</who>
    <bug_when>2020-08-18 16:47:27 -0700</bug_when>
    <thetext>In our webapp using webkit, we see an issue with certain AJAX requests, &quot;Failed to load resource: The network connection was lost.&quot;

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&apos;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</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1681303</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2020-08-19 00:50:06 -0700</bug_when>
    <thetext>&lt;rdar://problem/67385261&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1681500</commentid>
    <comment_count>2</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2020-08-19 15:30:11 -0700</bug_when>
    <thetext>&gt; 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?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1684235</commentid>
    <comment_count>3</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2020-08-31 13:36:47 -0700</bug_when>
    <thetext>As a workaround, can you use HTTP/2 instead instead of HTTP/1 or add `Keep-Alive: timeout=7` header?</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>