If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

allow for talos to run with --develop on older versions of python

RESOLVED FIXED

Status

Testing
Talos
RESOLVED FIXED
5 years ago
4 years ago

People

(Reporter: jmaher, Assigned: wlach)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

5 years ago
While running on Talos on linux and windows while using --develop, we get this in our logs:

Traceback (most recent call last):
  File "PerfConfigurator.py", line 864, in <module>
    sys.exit(main())
  File "PerfConfigurator.py", line 856, in main
    options, args = conf.parse_args(args)
  File "PerfConfigurator.py", line 521, in parse_args
    options, args = Configuration.parse_args(self, *args, **kwargs)
  File "/home/cltbld/talos-slave/talos-data/talos/configuration.py", line 476, in parse_args
    self(*config)
  File "PerfConfigurator.py", line 333, in __call__
    return Configuration.__call__(self, *args)
  File "/home/cltbld/talos-slave/talos-data/talos/configuration.py", line 380, in __call__
    self.validate()
  File "PerfConfigurator.py", line 425, in validate
    self.config['webserver'] = 'localhost:%s' % utils.findOpenPort('127.0.0.1')
  File "/home/cltbld/talos-slave/talos-data/talos/utils.py", line 277, in findOpenPort
    from mozdevice import devicemanager
  File "/home/cltbld/talos-slave/talos-data/talos/mozdevice/__init__.py", line 5, in <module>
    from devicemanager import DMError
  File "/home/cltbld/talos-slave/talos-data/talos/mozdevice/devicemanager.py", line 526
    raw_data = b"".join(b'\x00' + buf[span:span + width_byte_4] for span in range(0, (height - 1) * width * 4, width_byte_4))



can we try/except around this so we can run mozhttpd and --develop on production talos?
We could. I would prefer to just modify the methods in question not to depend on mozdevice.

For findOpenPort, we could replace it with something like this:

def get_open_port():
        import socket
        s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
        s.bind(("",0))
        s.listen(1)
        port = s.getsockname()[1]
        s.close()
        return port

(this is actually a bad practice which we should eventually avoid, see: https://bugzilla.mozilla.org/show_bug.cgi?id=788604#c4)

For getLanIp(), we could just call into mozhttpd's iface method, something like:

mozhttpd.iface.get_lan_ip()
Meh, might as well actually do the patch too.
Assignee: nobody → wlachance
Created attachment 674803 [details] [diff] [review]
Remove use of mozdevice's network tools

How about this?
Attachment #674803 - Flags: review?(jmaher)
(Reporter)

Comment 4

5 years ago
Comment on attachment 674803 [details] [diff] [review]
Remove use of mozdevice's network tools

Review of attachment 674803 [details] [diff] [review]:
-----------------------------------------------------------------

this looks pretty good.
Attachment #674803 - Flags: review?(jmaher) → review+
Pushed: https://tbpl.mozilla.org/?tree=Try&rev=e91a5afba8da
(Reporter)

Comment 6

4 years ago
right now we use python 2.7 everywhere, --develop works fine, can we close this bug?

Comment 7

4 years ago
wfm; closing.  Please reopen if this is still an issue.
Status: NEW → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.