Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[sweep:integration] Avoid locking in MessageQueueHandler #7969

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,15 @@ def emit(self, record):
strRecord = self.format(record)
if self.producer is not None:
self.producer.put(json.loads(strRecord))

def handle(self, record):
"""
Conditionally emit the specified logging record.

Override the handle method from logging.Handler as there is no need to
acquire the lock to emit the record.
"""
rv = self.filter(record)
if rv:
self.emit(record)
return rv
Loading