comparison mercurial/commandserver.py @ 44368:6392bd7c26a8

darwin: add another preemptive gui() call when using chg Changeset a89381e04c58 added this gui() call before background forks, and Google's extensions do background forks on essentially every invocation for logging purposes. The crash is reliably (though not 100%) reproducible without this change when running `HGPLAIN=1 chg status` in one of our repos. With this fix, I haven't been able to trigger the crash anymore. Differential Revision: https://phab.mercurial-scm.org/D8141
author Kyle Lippincott <spectral@google.com>
date Thu, 20 Feb 2020 15:15:23 -0800
parents 9f70512ae2cf
children f5c006621f07
comparison
equal deleted inserted replaced
44367:9dab3fa64325 44368:6392bd7c26a8
543 # experimental config: cmdserver.max-repo-cache 543 # experimental config: cmdserver.max-repo-cache
544 maxlen = ui.configint(b'cmdserver', b'max-repo-cache') 544 maxlen = ui.configint(b'cmdserver', b'max-repo-cache')
545 if maxlen < 0: 545 if maxlen < 0:
546 raise error.Abort(_(b'negative max-repo-cache size not allowed')) 546 raise error.Abort(_(b'negative max-repo-cache size not allowed'))
547 self._repoloader = repocache.repoloader(ui, maxlen) 547 self._repoloader = repocache.repoloader(ui, maxlen)
548 # attempt to avoid crash in CoreFoundation when using chg after fix in
549 # a89381e04c58
550 if pycompat.isdarwin:
551 procutil.gui()
548 552
549 def init(self): 553 def init(self):
550 self._sock = socket.socket(socket.AF_UNIX) 554 self._sock = socket.socket(socket.AF_UNIX)
551 # IPC channel from many workers to one main process; this is actually 555 # IPC channel from many workers to one main process; this is actually
552 # a uni-directional pipe, but is backed by a DGRAM socket so each 556 # a uni-directional pipe, but is backed by a DGRAM socket so each