[mozproxy] Improve mitmdump start/stop process
Categories
(Testing :: Mozbase, enhancement)
Tracking
(firefox68 fixed)
Tracking | Status | |
---|---|---|
firefox68 | --- | fixed |
People
(Reporter: tarek, Assigned: tarek)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
Instead of the 10s sleep we currently have, followed by a poll, a better way to verify that mitmdump is up and running is to try to connect to it via TCP.
This will speed up the start time and avoid a case where the process is started but the proxy is not really working.
e.g.
import socket
def check_proxy(host='localhost', port=8080):
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
try:
s.connect((host, port))
s.shutdown(socket.SHUT_RDWR)
s.close()
return True
except socket.error:
return False
Assignee | ||
Comment 1•5 years ago
|
||
This patch will remove the very long wait on start and stop,
should be down to one second.
Assignee | ||
Comment 2•5 years ago
|
||
Assignee | ||
Comment 3•5 years ago
|
||
Updated•5 years ago
|
Assignee | ||
Comment 4•5 years ago
|
||
Comment 5•5 years ago
|
||
This looks to be a generic mozbase package now. Moving to the correct component.
Updated•5 years ago
|
Pushed by tziade@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/2811220eaad7 Improve mitmdump start/stop process - r=whimboo
Comment 7•5 years ago
|
||
bugherder |
Comment 8•5 years ago
|
||
This looks to be causing a regression for me when running locally:
I now see this error:
16:50:19 INFO - mozproxy Starting mitmproxy playback using command: /Users/acreskey/dev/src/build/obj-release/testing/mozproxy/mitmdump -k -s ""/Users/acreskey/dev/src/mozilla-central/testing/raptor/raptor/playback/alternate-server-replay.py /Users/acreskey/dev/src/build/obj-release/testing/mozproxy/amazon.mp""
16:50:20 INFO - mozproxy Aborting: mitmproxy playback process failed to work
16:50:20 INFO - mozproxy Stopping mitmproxy playback, killing process 1852
16:50:20 INFO - mozproxy Mitmproxy exited with error code -15
But if I run the given playback command from the terminal, mitmproxy starts up:
~/dev/src/mozilla-central$ /Users/acreskey/dev/src/build/obj-release/testing/mozproxy/mitmdump -k -s ""/Users/acreskey/dev/src/mozilla-central/testing/raptor/raptor/playback/alternate-server-replay.py /Users/acreskey/dev/src/build/obj-release/testg/mozproxy/amazon.mp""
Loading script: /Users/acreskey/dev/src/mozilla-central/testing/raptor/raptor/playback/alternate-server-replay.py
Replaying from files: []
Proxy server listening at http://0.0.0.0:8080
I'm on a MacbookPro. I did make sure that there was no other instance of mitmdump running.
Comment 9•5 years ago
•
|
||
The info why it is failing to start-up is pretty unclear. Do we have a chance to get mozprocess to give some more information which could be added to this log entry? I would suggest filing a new bug for that improvement/fix.
Comment 10•5 years ago
|
||
Note, that I'm also seeing this problem. I filed bug 1538677 to get this fixed/improved.
Description
•