element-hq / element-hq/synapse
Make `/context` cancellable
- Dominant language
- Python
- Stars
- 4.6k
- Forks
- 600
- Avg merge
- 5d 22h
- Merged PRs (30d)
- 51
Description
This issue has been migrated from [#14467](https://github.com/matrix-org/synapse/issues/14467).
---
*Follow-up to https://github.com/vector-im/sre-internal/issues/1689 as [mentioned by @reivilibre](https://matrix.to/#/!SGNQGPGUwtcPBUotTL:matrix.org/$PLwm4zDzHdYfK65eklNR7ngCSsl7Op8c66om_CR7qPw?via=jki.re&via=matrix.org&via=element.io),*
*This has the same description as https://github.com/matrix-org/synapse/issues/14443 but this issue is focusing on making `/context` cancellable whereas the other issue was resolved after fixing the main performance problem of `/context` that caused the degraded situation.*
---
There was a `/context` request that ran for 12345.92s (3.4 hours) in Matrix HQ (`!OGEhHVWSdvArJzumhm:matrix.org`) but the client disconnected after 180s (client timeout). This would be a good endpoint candidate to make cancelable (`@cancellable`).
We can limit the exposure of any underlying performance problem by making it cancel on client disconnect. Plus we're doing work for nothing.
---
In the same vein as https://github.com/matrix-org/synapse/issues/14290 for `/search`
Contributor guide
Assessment
This issue has not been assessed yet.