Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Make linearizer more quiet (#4507)
Browse files Browse the repository at this point in the history
  • Loading branch information
hawkowl authored Jan 29, 2019
1 parent 073f6c2 commit f815bd7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions changelog.d/4507.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Reduce the log level of linearizer lock acquirement to DEBUG.
10 changes: 5 additions & 5 deletions synapse/util/async_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ def queue(self, key):
if entry[0] >= self.max_count:
res = self._await_lock(key)
else:
logger.info(
logger.debug(
"Acquired uncontended linearizer lock %r for key %r", self.name, key,
)
entry[0] += 1
Expand All @@ -215,7 +215,7 @@ def _ctx_manager(_):
try:
yield
finally:
logger.info("Releasing linearizer lock %r for key %r", self.name, key)
logger.debug("Releasing linearizer lock %r for key %r", self.name, key)

# We've finished executing so check if there are any things
# blocked waiting to execute and start one of them
Expand Down Expand Up @@ -247,15 +247,15 @@ def _await_lock(self, key):
"""
entry = self.key_to_defer[key]

logger.info(
logger.debug(
"Waiting to acquire linearizer lock %r for key %r", self.name, key,
)

new_defer = make_deferred_yieldable(defer.Deferred())
entry[1][new_defer] = 1

def cb(_r):
logger.info("Acquired linearizer lock %r for key %r", self.name, key)
logger.debug("Acquired linearizer lock %r for key %r", self.name, key)
entry[0] += 1

# if the code holding the lock completes synchronously, then it
Expand All @@ -273,7 +273,7 @@ def cb(_r):
def eb(e):
logger.info("defer %r got err %r", new_defer, e)
if isinstance(e, CancelledError):
logger.info(
logger.debug(
"Cancelling wait for linearizer lock %r for key %r",
self.name, key,
)
Expand Down

0 comments on commit f815bd7

Please sign in to comment.