<?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>183156</bug_id>
          
          <creation_ts>2018-02-26 19:16:04 -0800</creation_ts>
          <short_desc>webkitpy Bugzilla transactions should retry on URLError</short_desc>
          <delta_ts>2018-02-28 13:35:44 -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=182987</see_also>
    
    <see_also>https://bugs.webkit.org/show_bug.cgi?id=183222</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</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>dean_johnson</cc>
    
    <cc>ews-watchlist</cc>
    
    <cc>glenn</cc>
    
    <cc>jbedard</cc>
    
    <cc>lforschler</cc>
    
    <cc>thorton</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1402246</commentid>
    <comment_count>0</comment_count>
    <who name="Aakash Jain">aakash_jain</who>
    <bug_when>2018-02-26 19:16:04 -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;.

We added URLError handling in NetworkTransaction class, and Network issues while communicating with webkit-queues server reduced drastically (https://bugs.webkit.org/show_bug.cgi?id=182987). Bugzilla class in webkitpy should also use NetworkTransaction class to use the retry functionality.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1402247</commentid>
    <comment_count>1</comment_count>
    <who name="Aakash Jain">aakash_jain</who>
    <bug_when>2018-02-26 19:16:28 -0800</bug_when>
    <thetext>Few examples of failures while talking to bugzilla:

https://webkit-queues.webkit.org/results/6681924
https://webkit-queues.webkit.org/results/6681223
https://webkit-queues.webkit.org/results/6681840</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1402248</commentid>
    <comment_count>2</comment_count>
    <who name="Aakash Jain">aakash_jain</who>
    <bug_when>2018-02-26 19:18:20 -0800</bug_when>
    <thetext>e.g.:

2018-02-25 12:28:08,404 - Fetching: https://bugs.webkit.org/attachment.cgi?id=334583&amp;action=edit
2018-02-25 12:28:08,866 - Fetching: https://bugs.webkit.org/show_bug.cgi?id=183109&amp;ctype=xml&amp;excludefield=attachmentdata
2018-02-25 12:28:09,186 - Running: webkit-patch --status-host=webkit-queues.webkit.org --bot-id=webkit-misc-style apply-attachment --no-update --non-interactive 334583
2018-02-25 12:28:26,507 - Applied patch
2018-02-25 12:28:27,929 - Fetching: https://bugs.webkit.org/attachment.cgi?id=334583&amp;action=edit
Traceback (most recent call last):
  File &quot;/Volumes/Data/StyleQueue/WebKit/Tools/Scripts/webkitpy/tool/bot/queueengine.py&quot;, line 103, in run 
    if not self._delegate.process_work_item(work_item):
  File &quot;/Volumes/Data/StyleQueue/WebKit/Tools/Scripts/webkitpy/tool/commands/queues.py&quot;, line 452, in process_work_item
    passed = self.review_patch(patch)
  File &quot;/Volumes/Data/StyleQueue/WebKit/Tools/Scripts/webkitpy/tool/commands/queues.py&quot;, line 476, in review_patch
    style_check_succeeded = task.run()
  File &quot;/Volumes/Data/StyleQueue/WebKit/Tools/Scripts/webkitpy/tool/bot/stylequeuetask.py&quot;, line 75, in run 
    self._apply_watch_list()
  File &quot;/Volumes/Data/StyleQueue/WebKit/Tools/Scripts/webkitpy/tool/bot/stylequeuetask.py&quot;, line 66, in _apply_watch_list
    &quot;Unabled to apply watchlist&quot;)
  File &quot;/Volumes/Data/StyleQueue/WebKit/Tools/Scripts/webkitpy/tool/bot/patchanalysistask.py&quot;, line 97, in _run_command
    if not self.validate():
  File &quot;/Volumes/Data/StyleQueue/WebKit/Tools/Scripts/webkitpy/tool/bot/stylequeuetask.py&quot;, line 39, in validate
    self._patch = self._delegate.refetch_patch(self._patch)
  File &quot;/Volumes/Data/StyleQueue/WebKit/Tools/Scripts/webkitpy/tool/commands/queues.py&quot;, line 511, in refetch_patch
    return self._tool.bugs.fetch_attachment(patch.id())
  File &quot;/Volumes/Data/StyleQueue/WebKit/Tools/Scripts/webkitpy/common/net/bugzilla/bugzilla.py&quot;, line 518, in fetch_attachment
    bug_id = self.bug_id_for_attachment_id(attachment_id)
  File &quot;/Volumes/Data/StyleQueue/WebKit/Tools/Scripts/webkitpy/common/net/bugzilla/bugzilla.py&quot;, line 508, in bug_id_for_attachment_id
    page = self.browser.open(attachment_url)
  File &quot;/Volumes/Data/StyleQueue/WebKit/Tools/Scripts/webkitpy/thirdparty/autoinstalled/mechanize/_mechanize.py&quot;, line 203, in open
    return self._mech_open(url, data, timeout=timeout)
  File &quot;/Volumes/Data/StyleQueue/WebKit/Tools/Scripts/webkitpy/thirdparty/autoinstalled/mechanize/_mechanize.py&quot;, line 230, in _mech_open
    response = UserAgentBase.open(self, request, data)
  File &quot;/Volumes/Data/StyleQueue/WebKit/Tools/Scripts/webkitpy/thirdparty/autoinstalled/mechanize/_opener.py&quot;, line 193, in open
    response = urlopen(self, req, data)
  File &quot;/Volumes/Data/StyleQueue/WebKit/Tools/Scripts/webkitpy/thirdparty/autoinstalled/mechanize/_urllib2_fork.py&quot;, line 344, in _open
    &apos;_open&apos;, req)
  File &quot;/Volumes/Data/StyleQueue/WebKit/Tools/Scripts/webkitpy/thirdparty/autoinstalled/mechanize/_urllib2_fork.py&quot;, line 332, in _call_chain
    result = func(*args)
  File &quot;/Volumes/Data/StyleQueue/WebKit/Tools/Scripts/webkitpy/thirdparty/autoinstalled/mechanize/_urllib2_fork.py&quot;, line 1170, in https_open
    return self.do_open(conn_factory, req)
  File &quot;/Volumes/Data/StyleQueue/WebKit/Tools/Scripts/webkitpy/thirdparty/autoinstalled/mechanize/_urllib2_fork.py&quot;, line 1118, in do_open
    raise URLError(err)
URLError: &lt;urlopen error [Errno 60] Operation timed out&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1402249</commentid>
    <comment_count>3</comment_count>
      <attachid>334665</attachid>
    <who name="Aakash Jain">aakash_jain</who>
    <bug_when>2018-02-26 19:20:03 -0800</bug_when>
    <thetext>Created attachment 334665
Proposed patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1402275</commentid>
    <comment_count>4</comment_count>
    <who name="Aakash Jain">aakash_jain</who>
    <bug_when>2018-02-26 21:25:36 -0800</bug_when>
    <thetext>iOS EWS for this patch failed with exactly same network issue which would be fixed by this patch.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1402292</commentid>
    <comment_count>5</comment_count>
    <who name="Dean Johnson">dean_johnson</who>
    <bug_when>2018-02-26 23:37:13 -0800</bug_when>
    <thetext>Aakash asked me to look this over this afternoon; I took a look at NetworkTransaction&apos;s implementation and the use of lambdas here and everything looks like it should work as described by Aakash.

Unofficial r=me.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1402351</commentid>
    <comment_count>6</comment_count>
      <attachid>334665</attachid>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2018-02-27 09:54:18 -0800</bug_when>
    <thetext>Comment on attachment 334665
Proposed patch

Clearing flags on attachment: 334665

Committed r229064: &lt;https://trac.webkit.org/changeset/229064&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1402352</commentid>
    <comment_count>7</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2018-02-27 09:54:20 -0800</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1402353</commentid>
    <comment_count>8</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2018-02-27 09:55:29 -0800</bug_when>
    <thetext>&lt;rdar://problem/37945984&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1402702</commentid>
    <comment_count>9</comment_count>
    <who name="Aakash Jain">aakash_jain</who>
    <bug_when>2018-02-28 13:26:13 -0800</bug_when>
    <thetext>This seems to help significantly. Noticing the logs, all the patches below would have failed ews with network exceptions, which now worked properly.


ews109:
2018-02-28 09:55:14,708 - Fetching: https://bugs.webkit.org/attachment.cgi?id=334748&amp;action=edit
2018-02-28 09:55:22,578 - Received URLError: [Errno 60] Operation timed out. Retrying in 10 seconds...


2018-02-28 10:54:30,971 - Fetching: https://bugs.webkit.org/show_bug.cgi?id=183191&amp;ctype=xml&amp;excludefield=attachmentdata
2018-02-28 10:55:45,975 - Received URLError: [Errno 60] Operation timed out. Retrying in 10 seconds...
2018-02-28 10:55:56,258 - Started processing patch

2018-02-28 11:30:09,177 - Fetching: https://bugs.webkit.org/show_bug.cgi?id=183184&amp;ctype=xml&amp;excludefield=attachmentdata
2018-02-28 11:30:17,102 - Received URLError: [Errno 60] Operation timed out. Retrying in 10 seconds...
2018-02-28 11:30:27,401 - Started processing patch

2018-02-28 11:30:28,085 - Fetching: https://bugs.webkit.org/show_bug.cgi?id=183184&amp;ctype=xml&amp;excludefield=attachmentdata
2018-02-28 11:30:36,017 - Received URLError: [Errno 60] Operation timed out. Retrying in 10 seconds...
2018-02-28 11:30:46,312 - Running: webkit-patch --status-host=webkit-queues.webkit.org --bot-id=ews109 clean --port=ios-device --architecture=arm64


ews108:
2018-02-28 06:33:50,141 - Fetching: https://bugs.webkit.org/attachment.cgi?id=334742&amp;action=edit
2018-02-28 06:35:05,177 - Received URLError: [Errno 60] Operation timed out. Retrying in 10 seconds...
2018-02-28 06:35:15,187 - Fetching: https://bugs.webkit.org/attachment.cgi?id=334742&amp;action=edit
2018-02-28 06:36:30,202 - Received URLError: [Errno 60] Operation timed out. Retrying in 15.0 seconds...
2018-02-28 06:36:45,211 - Fetching: https://bugs.webkit.org/attachment.cgi?id=334742&amp;action=edit

2018-02-28 08:56:08,825 - Fetching: https://bugs.webkit.org/attachment.cgi?id=334369&amp;action=edit
2018-02-28 08:57:23,847 - Received URLError: [Errno 60] Operation timed out. Retrying in 10 seconds...
2018-02-28 08:57:33,857 - Fetching: https://bugs.webkit.org/attachment.cgi?id=334369&amp;action=edit


2018-02-28 11:50:43,646 - Fetching: https://bugs.webkit.org/show_bug.cgi?id=183218&amp;ctype=xml&amp;excludefield=attachmentdata
2018-02-28 11:50:51,515 - Received URLError: [Errno 60] Operation timed out. Retrying in 10 seconds...
2018-02-28 11:51:01,759 - Running: webkit-patch --status-host=webkit-queues.webkit.org --bot-id=ews108 clean --port=ios-device --architecture=arm64


2018-02-28 12:59:05,387 - Applied patch
2018-02-28 12:59:05,788 - Fetching: https://bugs.webkit.org/attachment.cgi?id=334759&amp;action=edit
2018-02-28 12:59:13,791 - Received URLError: [Errno 60] Operation timed out. Retrying in 10 seconds...
2018-02-28 12:59:23,799 - Fetching: https://bugs.webkit.org/attachment.cgi?id=334759&amp;action=edit</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1402705</commentid>
    <comment_count>10</comment_count>
    <who name="Aakash Jain">aakash_jain</who>
    <bug_when>2018-02-28 13:28:08 -0800</bug_when>
    <thetext>Note that this fixed</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1402706</commentid>
    <comment_count>11</comment_count>
    <who name="Aakash Jain">aakash_jain</who>
    <bug_when>2018-02-28 13:35:44 -0800</bug_when>
    <thetext>Note that this added retry for some of the (frequent) network transactions with Bugzilla. We should add retry for ALL the network transaction with Bugzilla. Tracked in https://bugs.webkit.org/show_bug.cgi?id=183222</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>334665</attachid>
            <date>2018-02-26 19:20:03 -0800</date>
            <delta_ts>2018-02-27 09:54:18 -0800</delta_ts>
            <desc>Proposed patch</desc>
            <filename>bugzilla_retry.patch</filename>
            <type>text/plain</type>
            <size>2265</size>
            <attacher name="Aakash Jain">aakash_jain</attacher>
            
              <data encoding="base64">SW5kZXg6IFRvb2xzL0NoYW5nZUxvZwo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBUb29scy9DaGFuZ2VMb2cJKHJl
dmlzaW9uIDIyOTA1MikKKysrIFRvb2xzL0NoYW5nZUxvZwkod29ya2luZyBjb3B5KQpAQCAtMSwz
ICsxLDE2IEBACisyMDE4LTAyLTI2ICBBYWthc2ggSmFpbiAgPGFha2FzaF9qYWluQGFwcGxlLmNv
bT4KKworICAgICAgICB3ZWJraXRweSBCdWd6aWxsYSB0cmFuc2FjdGlvbnMgc2hvdWxkIHJldHJ5
IG9uIFVSTEVycm9yCisgICAgICAgIGh0dHBzOi8vYnVncy53ZWJraXQub3JnL3Nob3dfYnVnLmNn
aT9pZD0xODMxNTYKKworICAgICAgICBSZXZpZXdlZCBieSBOT0JPRFkgKE9PUFMhKS4KKworICAg
ICAgICAqIFNjcmlwdHMvd2Via2l0cHkvY29tbW9uL25ldC9idWd6aWxsYS9idWd6aWxsYS5weToK
KyAgICAgICAgKEJ1Z3ppbGxhKTogVXNlIE5ldHdvcmtUcmFuc2FjdGlvbi4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2F0dGFjaG1lbnRfaWQoc2VsZiwgYXR0YWNobWVudF9pZCk6CiAgICAgICAg
IHNlbGYuYXV0aGVudGljYXRlKCkKIAogICAgICAgICBhdHRhY2htZW50X3VybCA9IHNlbGYuYXR0
YWNobWVudF91cmxfZm9yX2lkKGF0dGFjaG1lbnRfaWQsICdlZGl0JykK
</data>

          </attachment>
      

    </bug>

</bugzilla>