mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Try to unlock the global lock in StructuredLogger after reloading logging
This should finally fix all the websockets related failures we've been seeing lately.
This commit is contained in:
parent
82e94e3b67
commit
c692094225
2 changed files with 9 additions and 5 deletions
|
@ -19,8 +19,10 @@ from collections import defaultdict, OrderedDict
|
|||
from multiprocessing import Process, Event
|
||||
|
||||
from localpaths import repo_root
|
||||
from six.moves import reload_module
|
||||
|
||||
from manifest.sourcefile import read_script_metadata, js_meta_re, parse_variants
|
||||
from mozlog.structuredlog import StructuredLogger
|
||||
from wptserve import server as wptserve, handlers
|
||||
from wptserve import stash
|
||||
from wptserve import config
|
||||
|
@ -631,9 +633,10 @@ class WebSocketDaemon(object):
|
|||
def start_ws_server(host, port, paths, routes, bind_address, config, **kwargs):
|
||||
# Ensure that when we start this in a new process we have the global lock
|
||||
# in the logging module unlocked
|
||||
reload_module(logging)
|
||||
try:
|
||||
logging._releaseLock()
|
||||
except RuntimeError:
|
||||
StructuredLogger._lock.release()
|
||||
except threading.ThreadError:
|
||||
pass
|
||||
return WebSocketDaemon(host,
|
||||
str(port),
|
||||
|
@ -647,9 +650,10 @@ def start_ws_server(host, port, paths, routes, bind_address, config, **kwargs):
|
|||
def start_wss_server(host, port, paths, routes, bind_address, config, **kwargs):
|
||||
# Ensure that when we start this in a new process we have the global lock
|
||||
# in the logging module unlocked
|
||||
reload_module(logging)
|
||||
try:
|
||||
logging._releaseLock()
|
||||
except RuntimeError:
|
||||
StructuredLogger._lock.release()
|
||||
except threading.ThreadError:
|
||||
pass
|
||||
return WebSocketDaemon(host,
|
||||
str(port),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue