diff mercurial/hgweb/hgweb_mod.py @ 37849:5b831053d9b6 stable

hgweb: do not try to replace signal handlers while locking According to the issue 5889, mod_wsgi issues a warning on signal.signal() call, and we wouldn't want to see it in error log. The problem addressed by d77c3b023393 could potentially occur in web session, but that would be less likely than in user processes.
author Yuya Nishihara <yuya@tcha.org>
date Fri, 18 May 2018 21:32:05 +0900
parents 11ee9bf24791
children 519b46a8f4d2
line wrap: on
line diff
--- a/mercurial/hgweb/hgweb_mod.py	Fri May 18 21:24:06 2018 +0900
+++ b/mercurial/hgweb/hgweb_mod.py	Fri May 18 21:32:05 2018 +0900
@@ -225,6 +225,12 @@
         # resolve file patterns relative to repo root
         r.ui.setconfig('ui', 'forcecwd', r.root, 'hgweb')
         r.baseui.setconfig('ui', 'forcecwd', r.root, 'hgweb')
+        # it's unlikely that we can replace signal handlers in WSGI server,
+        # and mod_wsgi issues a big warning. a plain hgweb process (with no
+        # threading) could replace signal handlers, but we don't bother
+        # conditionally enabling it.
+        r.ui.setconfig('ui', 'signal-safe-lock', 'false', 'hgweb')
+        r.baseui.setconfig('ui', 'signal-safe-lock', 'false', 'hgweb')
         # displaying bundling progress bar while serving feel wrong and may
         # break some wsgi implementation.
         r.ui.setconfig('progress', 'disable', 'true', 'hgweb')