element-hq / element-hq/synapse

replace loggingcontexts with contextvars

Open
#10,342 2 comments 0 reactions 0 assignees View on GitHub
A-Logging P3 T-Enhancement
Dominant language
Python
Stars
4.6k
Forks
600
Avg merge
5d 22h
Merged PRs (30d)
51

Description

This issue has been migrated from [#10342](https://github.com/matrix-org/synapse/issues/10342).

---

logcontexts are super confusing, and easy to mess up.

We should experiment with replacing the thread-local variable we currently use with a [`contextvar`](https://docs.python.org/3/library/contextvars.html), which Twisted has first-class support for (https://github.com/twisted/twisted/pull/1192), which could potentially save everyone who ever touches Synapse code a great deal of pain.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.