dendrite/internal
Kegsay f8d3a762c4
Add a per-room mutex to federationapi when processing transactions (#1810)
* Add a per-room mutex to federationapi when processing transactions

This has numerous benefits:
 - Prevents us doing lots of state resolutions in busy rooms. Previously, room forks would always result
   in a state resolution being performed immediately, without checking if we were already doing this in
   a different transaction. Now they will queue up, resulting in fewer calls to `/state_ids`, `/g_m_e`, etc.
 - Prevents memory usage from growing too large as a result and potentially OOMing.

And costs:
 - High traffic rooms will be slightly slower due to head-of-line blocking from other servers,
   though this has always been an issue as roomserver has a per-room mutex already.

* Fix unit tests

* Correct mutex lock ordering
2021-03-30 10:01:32 +01:00
..
caching Gradually evict oldest cache entries (#1768) 2021-02-17 13:50:27 +00:00
eventutil Top-level setup package (#1605) 2020-12-02 17:41:00 +00:00
hooks MSC2836: Threading - part one (#1589) 2020-11-19 11:34:59 +00:00
httputil Add Sentry support (#1803) 2021-03-24 10:25:24 +00:00
sqlutil Top-level setup package (#1605) 2020-12-02 17:41:00 +00:00
test Top-level setup package (#1605) 2020-12-02 17:41:00 +00:00
transactions Implement read receipts (#1528) 2020-11-09 18:46:11 +00:00
consumers.go Graceful shutdowns (#1734) 2021-01-26 12:56:20 +00:00
log.go Top-level setup package (#1605) 2020-12-02 17:41:00 +00:00
mutex.go Add a per-room mutex to federationapi when processing transactions (#1810) 2021-03-30 10:01:32 +01:00
version.go Version 0.3.11 2021-03-02 11:46:35 +00:00