Commit Graph
2 Commits
Author SHA1 Message Date
Erik JohnstonandClaude Opus 5 e8f39a3f0e Count wait_for_stream_token timeouts per lagging stream
When a worker's replication of a stream stalls, clients whose previous
sync was served by a worker ahead of it hand us a token we will never
catch up to, `wait_for_stream_token` times out after 10s and `/sync`
returns an empty response indefinitely. Nothing metric-side pointed at
which stream had stalled (see #20080, where it was `quarantined_media`).

Count the timeouts against each stream the token is still ahead of us on,
and name those streams (and their positions) in the logs instead of
dumping two whole tokens.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-12 13:18:58 +01:00
Eric Eastwood b233892a13 Update wait_for_stream_token(...) patterns and fix sync fetching with unbounded token (#19644)
Spawning from trying to find the proper way to wait for a token, see
https://github.com/element-hq/synapse/pull/19558#discussion_r2977673208

- Update `wait_for_stream_token(...)` patterns so
validation/sanitization is handled upstream in usage.
- Fix sync waiting for bounded token but using unbounded token to fetch
data. Noticed while working on adding the new method.

Part of https://github.com/element-hq/synapse/issues/19647
2026-05-14 14:53:16 -05:00