sapling/hgext/zeroconf
Jun Wu 02fcca0577 zeroconf: do not crash if socket being read is closed by another thread
In zeroconf/__init__.py, there is:

    server = Zeroconf.Zeroconf(ip)
    l = listener()
    Zeroconf.ServiceBrowser(server, "_hg._tcp.local.", l)
    time.sleep(1)
    server.close()

`server.close()` closes the underlying socket while the `ServiceBrowser` may
still have a background thread reading the socket. There could be a race
condition where the reading thread reads the closed socket, resulting in
EBADF crash. This patch catches the exception.

This makes test-paths.t pass with chg.

Differential Revision: https://phab.mercurial-scm.org/D919
2017-10-02 20:23:25 -07:00
..
__init__.py configitems: register the 'web.description' config 2017-06-30 03:45:43 +02:00
Zeroconf.py zeroconf: do not crash if socket being read is closed by another thread 2017-10-02 20:23:25 -07:00