Mercurial > hg
diff mercurial/localrepo.py @ 38038:8c828beb7543 stable
lock: add internal config to not replace signal handlers while locking
signal.signal() is blocked in some WSGI environments, and a horrible warning
is sent to the server log. So we need a way to disable it, and I think
abusing ui.config is the simplest workaround.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Fri, 18 May 2018 21:24:06 +0900 |
parents | 856f381ad74b |
children | ead71b15efd5 |
line wrap: on
line diff
--- a/mercurial/localrepo.py Tue May 22 21:51:20 2018 -0400 +++ b/mercurial/localrepo.py Fri May 18 21:24:06 2018 +0900 @@ -1693,12 +1693,15 @@ if wait: timeout = self.ui.configint("ui", "timeout") warntimeout = self.ui.configint("ui", "timeout.warn") + # internal config: ui.signal-safe-lock + signalsafe = self.ui.configbool('ui', 'signal-safe-lock') l = lockmod.trylock(self.ui, vfs, lockname, timeout, warntimeout, releasefn=releasefn, acquirefn=acquirefn, desc=desc, inheritchecker=inheritchecker, - parentlock=parentlock) + parentlock=parentlock, + signalsafe=signalsafe) return l def _afterlock(self, callback):