element-hq / element-hq/synapse

Synapse should track `Clock.sleep(...)` to cancel during `shutdown`

Open
#19,190 0 comments 0 reactions 0 assignees View on GitHub
A-Shutdown O-Uncommon S-Tolerable T-Defect
Dominant language
Python
Stars
4.6k
Forks
600
Avg merge
5d 22h
Merged PRs (30d)
51

Description

Currently, we only track [`Clock.call_later(...)`](https://github.com/element-hq/synapse/blob/edc0de9fa00210975dad2d3faa27639ea9b7f5e2/synapse/util/clock.py#L252-L341) calls but [`Clock.sleep(...)`](https://github.com/element-hq/synapse/blob/edc0de9fa00210975dad2d3faa27639ea9b7f5e2/synapse/util/clock.py#L87-L95) can equally hold references to the homeserver and need to be cleaned up during [`shutdown`](https://github.com/element-hq/synapse/blob/edc0de9fa00210975dad2d3faa27639ea9b7f5e2/synapse/server.py#L420-L517) in order for the homeserver to be garbage collected.

Spawning from https://github.com/element-hq/synapse-small-hosts/pull/204#discussion_r2525000337

Follow-up to https://github.com/element-hq/synapse/pull/18828

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.