Skip to content

Commit

Permalink
Try to unlock the global lock in StructuredLogger after reloading log…
Browse files Browse the repository at this point in the history
…ging

This should finally fix all the websockets related failures we've been
seeing lately.
  • Loading branch information
Eijebong committed Sep 18, 2018
1 parent 82e94e3 commit c692094
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion tests/wpt/metadata/MANIFEST.json
Expand Up @@ -650026,7 +650026,7 @@
"support"
],
"tools/serve/serve.py": [
"31a08dbd016752db5925410dbf5435a0e8623981",
"104701caf85ba2250d4c844650025517f0d473b6",
"support"
],
"tools/serve/test_functional.py": [
Expand Down
12 changes: 8 additions & 4 deletions tests/wpt/web-platform-tests/tools/serve/serve.py
Expand Up @@ -19,8 +19,10 @@
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
Expand Down Expand Up @@ -631,9 +633,10 @@ def stop(self):
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),
Expand All @@ -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),
Expand Down

0 comments on commit c692094

Please sign in to comment.