Mercurial > public > mercurial-scm > hg
comparison 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 |
comparison
equal
deleted
inserted
replaced
38037:d46a38c07b1a | 38038:8c828beb7543 |
---|---|
1691 timeout = 0 | 1691 timeout = 0 |
1692 warntimeout = 0 | 1692 warntimeout = 0 |
1693 if wait: | 1693 if wait: |
1694 timeout = self.ui.configint("ui", "timeout") | 1694 timeout = self.ui.configint("ui", "timeout") |
1695 warntimeout = self.ui.configint("ui", "timeout.warn") | 1695 warntimeout = self.ui.configint("ui", "timeout.warn") |
1696 # internal config: ui.signal-safe-lock | |
1697 signalsafe = self.ui.configbool('ui', 'signal-safe-lock') | |
1696 | 1698 |
1697 l = lockmod.trylock(self.ui, vfs, lockname, timeout, warntimeout, | 1699 l = lockmod.trylock(self.ui, vfs, lockname, timeout, warntimeout, |
1698 releasefn=releasefn, | 1700 releasefn=releasefn, |
1699 acquirefn=acquirefn, desc=desc, | 1701 acquirefn=acquirefn, desc=desc, |
1700 inheritchecker=inheritchecker, | 1702 inheritchecker=inheritchecker, |
1701 parentlock=parentlock) | 1703 parentlock=parentlock, |
1704 signalsafe=signalsafe) | |
1702 return l | 1705 return l |
1703 | 1706 |
1704 def _afterlock(self, callback): | 1707 def _afterlock(self, callback): |
1705 """add a callback to be run when the repository is fully unlocked | 1708 """add a callback to be run when the repository is fully unlocked |
1706 | 1709 |