<?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>182987</bug_id>
          
          <creation_ts>2018-02-20 15:50:10 -0800</creation_ts>
          <short_desc>webkitpy NetworkTransaction should retry on URLError</short_desc>
          <delta_ts>2018-02-26 19:20:45 -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>Tools / Tests</component>
          <version>Other</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=182420</see_also>
    
    <see_also>https://bugs.webkit.org/show_bug.cgi?id=183156</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P1</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Aakash Jain">aakash_jain</reporter>
          <assigned_to name="Aakash Jain">aakash_jain</assigned_to>
          <cc>aakash_jain</cc>
    
    <cc>ap</cc>
    
    <cc>commit-queue</cc>
    
    <cc>ews-watchlist</cc>
    
    <cc>glenn</cc>
    
    <cc>jbedard</cc>
    
    <cc>lforschler</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1400930</commentid>
    <comment_count>0</comment_count>
    <who name="Aakash Jain">aakash_jain</who>
    <bug_when>2018-02-20 15:50:10 -0800</bug_when>
    <thetext>We have been seeing frequent network errors recently in https://bugs.webkit.org/show_bug.cgi?id=182420. We are debugging the root-cause to fix the underlying network issue in &lt;rdar://problem/37716391&gt;.

However, our code should be more robust against network failures and it should retry when it encounters network issue like: URLError: &lt;urlopen error [Errno 60] Operation timed out&gt;.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1400933</commentid>
    <comment_count>1</comment_count>
      <attachid>334310</attachid>
    <who name="Aakash Jain">aakash_jain</who>
    <bug_when>2018-02-20 15:53:55 -0800</bug_when>
    <thetext>Created attachment 334310
Proposed patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1400942</commentid>
    <comment_count>2</comment_count>
    <who name="Aakash Jain">aakash_jain</who>
    <bug_when>2018-02-20 16:06:53 -0800</bug_when>
    <thetext>This will add retry for webkit-queues network transactions, since they use NetworkTransaction class. This wouldn&apos;t fix network issues with Bugzilla as Bugzilla code use Mechanize directly.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1401113</commentid>
    <comment_count>3</comment_count>
    <who name="Jonathan Bedard">jbedard</who>
    <bug_when>2018-02-21 08:29:00 -0800</bug_when>
    <thetext>Unofficial R+.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1401171</commentid>
    <comment_count>4</comment_count>
      <attachid>334310</attachid>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2018-02-21 11:03:15 -0800</bug_when>
    <thetext>Comment on attachment 334310
Proposed patch

View in context: https://bugs.webkit.org/attachment.cgi?id=334310&amp;action=review

Seems fine given that e.filename doesn&apos;t appear to work. But it would be good to fix printing the URL both in this case and in the existing HTTPError case.

&gt; Tools/ChangeLog:3
&gt; +        webkitpy NetworkTransaction should retry on URLError

Is there any possibility of deadlocking here?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1401179</commentid>
    <comment_count>5</comment_count>
      <attachid>334310</attachid>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2018-02-21 11:27:56 -0800</bug_when>
    <thetext>Comment on attachment 334310
Proposed patch

Clearing flags on attachment: 334310

Committed r228885: &lt;https://trac.webkit.org/changeset/228885&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1401180</commentid>
    <comment_count>6</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2018-02-21 11:27:58 -0800</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1401181</commentid>
    <comment_count>7</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2018-02-21 11:28:20 -0800</bug_when>
    <thetext>&lt;rdar://problem/37754241&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1401224</commentid>
    <comment_count>8</comment_count>
    <who name="Aakash Jain">aakash_jain</who>
    <bug_when>2018-02-21 12:38:29 -0800</bug_when>
    <thetext>&gt; Is there any possibility of deadlocking here?
This class has a maximum Timeout of 10 minutes (timeout_seconds=(10 * 60)), so it wouldn&apos;t be stuck indefinitely retrying on network errors.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1401792</commentid>
    <comment_count>9</comment_count>
    <who name="Aakash Jain">aakash_jain</who>
    <bug_when>2018-02-23 12:57:59 -0800</bug_when>
    <thetext>This patch has definitely helped with network issues. Noticing the logs, all the patches below would have failed ews with network exceptions, which now worked properly.

e.g.:
ews109:
2018-02-21 12:55:17,769 - Started processing patch
2018-02-21 12:56:32,778 - Received URLError: [Errno 60] Operation timed out. Retrying in 10 seconds...
2018-02-21 12:56:43,353 - Fetching: https://bugs.webkit.org/attachment.cgi?id=334405&amp;action=edit
2018-02-21 12:56:43,628 - Fetching: https://bugs.webkit.org/show_bug.cgi?id=183013&amp;ctype=xml&amp;excludefield=attachmentdata
2018-02-21 12:56:43,891 - Running: webkit-patch --status-host=webkit-queues.webkit.org --bot-id=ews109 clean --port=ios-device --architecture=arm64


2018-02-21 16:22:46,539 - Applied patch
2018-02-21 16:24:01,662 - Received URLError: [Errno 60] Operation timed out. Retrying in 10 seconds...
2018-02-21 16:24:12,036 - Fetching: https://bugs.webkit.org/attachment.cgi?id=334424&amp;action=edit
2018-02-21 16:24:12,322 - Fetching: https://bugs.webkit.org/show_bug.cgi?id=182891&amp;ctype=xml&amp;excludefield=attachmentdata

2018-02-21 12:55:17,769 - Started processing patch
2018-02-21 12:56:32,778 - Received URLError: [Errno 60] Operation timed out. Retrying in 10 seconds...
2018-02-21 12:56:43,353 - Fetching: https://bugs.webkit.org/attachment.cgi?id=334405&amp;action=edit
2018-02-21 12:56:43,628 - Fetching: https://bugs.webkit.org/show_bug.cgi?id=183013&amp;ctype=xml&amp;excludefield=attachmentdata

ews108:

2018-02-23 06:57:01,397 - Built patch
2018-02-23 06:58:18,323 - Received URLError: [Errno 60] Operation timed out. Retrying in 10 seconds...
2018-02-23 06:59:43,470 - Received URLError: [Errno 60] Operation timed out. Retrying in 15.0 seconds...
2018-02-23 06:59:58,908 - Pass


2018-02-23 07:40:12,103 - Cleaned working directory
2018-02-23 07:41:27,849 - Received URLError: [Errno 60] Operation timed out. Retrying in 10 seconds...
2018-02-23 07:41:39,461 - Fetching: https://bugs.webkit.org/attachment.cgi?id=334533&amp;action=edit
2018-02-23 07:41:39,752 - Fetching: https://bugs.webkit.org/show_bug.cgi?id=183027&amp;ctype=xml&amp;excludefield=attachmentdata</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>334310</attachid>
            <date>2018-02-20 15:53:55 -0800</date>
            <delta_ts>2018-02-21 11:27:56 -0800</delta_ts>
            <desc>Proposed patch</desc>
            <filename>webkitpy_retry_on_timeout.patch</filename>
            <type>text/plain</type>
            <size>1517</size>
            <attacher name="Aakash Jain">aakash_jain</attacher>
            
              <data encoding="base64">SW5kZXg6IFRvb2xzL0NoYW5nZUxvZwo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBUb29scy9DaGFuZ2VMb2cJKHJl
dmlzaW9uIDIy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AgICAgICAgICAgICBzZWxm
Ll9jaGVja19mb3JfdGltZW91dCgpCiAgICAgICAgICAgICAgICAgX2xvZy53YXJuKCJSZWNlaXZl
ZCBIVFRQIHN0YXR1cyAlcyBsb2FkaW5nIFwiJXNcIi4gIFJldHJ5aW5nIGluICVzIHNlY29uZHMu
Li4iICUgKGUuY29kZSwgZS5maWxlbmFtZSwgc2VsZi5fYmFja29mZl9zZWNvbmRzKSkKICAgICAg
ICAgICAgICAgICBzZWxmLl9zbGVlcCgpCisgICAgICAgICAgICBleGNlcHQgdXJsbGliMi5VUkxF
cnJvciBhcyBlOgorICAgICAgICAgICAgICAgIHNlbGYuX2NoZWNrX2Zvcl90aW1lb3V0KCkKKyAg
ICAgICAgICAgICAgICBfbG9nLndhcm4oIlJlY2VpdmVkIFVSTEVycm9yOiB7fS4gUmV0cnlpbmcg
aW4ge30gc2Vjb25kcy4uLiIuZm9ybWF0KGUucmVhc29uLCBzZWxmLl9iYWNrb2ZmX3NlY29uZHMp
KQorICAgICAgICAgICAgICAgIHNlbGYuX3NsZWVwKCkKIAogICAgIGRlZiBfY2hlY2tfZm9yX3Rp
bWVvdXQoc2VsZik6CiAgICAgICAgIGlmIHNlbGYuX3RvdGFsX3NsZWVwICsgc2VsZi5fYmFja29m
Zl9zZWNvbmRzID4gc2VsZi5fdGltZW91dF9zZWNvbmRzOgo=
</data>

          </attachment>
      

    </bug>

</bugzilla>