Bug 1621657 - [mozproxy] MozProxy is running mitm 4.02 on win nodes r=tarek
authorFlorin Strugariu <fstrugariu@mozilla.com>
Wed, 11 Mar 2020 16:24:34 +0000
changeset 518233 1204e9ec1b49b8461f2373a81ea7d15e68bb081e
parent 518232 396cfd215808e69f319bc0fe7bbea7508ca8cdb7
child 518234 4d112690b957d3ec667a84a060b46d2117263b1d
push id109835
push userfstrugariu@mozilla.com
push dateWed, 11 Mar 2020 17:13:56 +0000
treeherderautoland@1204e9ec1b49 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstarek
bugs1621657
milestone76.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1621657 - [mozproxy] MozProxy is running mitm 4.02 on win nodes r=tarek Differential Revision: https://phabricator.services.mozilla.com/D66410
testing/mozbase/mozproxy/mozproxy/backends/mitm/scripts/alternate-server-replay.py
--- a/testing/mozbase/mozproxy/mozproxy/backends/mitm/scripts/alternate-server-replay.py
+++ b/testing/mozbase/mozproxy/mozproxy/backends/mitm/scripts/alternate-server-replay.py
@@ -128,17 +128,18 @@ class AlternateServerPlayback:
 
                         l = self.flowmap.setdefault(self._hash(i), [])
                         l.append(i)
                     else:
                         ctx.log.info(
                              "Recorded response %s has no content. Removing from recording list"
                              % i.request.url
                         )
-                if self.mitm_version == "4.0.4":
+                if self.mitm_version in ("4.0.2", "4.0.4"):
+                    # see: https://github.com/mitmproxy/mitmproxy/issues/3856
                     l = self.flowmap.setdefault(self._hash(i), [])
                     l.append(i)
             else:
                 ctx.log.info(
                     "Recorded request %s has no response. Removing from recording list"
                     % i.request.url
                 )
         ctx.master.addons.trigger("update", [])
@@ -245,16 +246,20 @@ class AlternateServerPlayback:
 
             # collecting stats only if we can dump them (see .done())
             if ctx.options.upload_dir:
                 parsed_url = urllib.parse.urlparse(parse.unquote(f.request.url))
                 self.netlocs[parsed_url.netloc][f.response.status_code] += 1
                 self.calls.append({'time': str(time.time()),
                                    'url': f.request.url,
                                    'response_status': f.response.status_code})
+        else:
+            ctx.log.error("Playback library is empty! Stopping playback process!")
+            ctx.master.shutdown()
+            return
 
 
 playback = AlternateServerPlayback()
 
 if hasattr(signal, 'SIGBREAK'):
     # allows the addon to dump the stats even if mitmproxy
     # does not call done() like on windows termination
     # for this, the parent process sends CTRL_BREAK_EVENT which