dendrite/roomserver/internal
Vivianne f24688af11
Adjust roomserver locks, don't unsubscribe if new event is inflight (#3588)
This should fix #3484 -- at the very least, it has resolved the issues
we've had on our instance. I've extended the lock so it surrounds the
unsubscribe as well as a new check if the latest sequential ID seen by
the ephemeral thread is newer than the sequential ID seen by the durable
thread. This solves a race where the unsubscribe happened while a new
message was inflight, and so the message was not handled.

This is a fix for a race condition that has been pretty unreliable to
reproduce manually, so I don't know if there's a good way to add a
reliable automated test for it. If you have any ideas I'm open to it.

### Pull Request Checklist

<!-- Please read
https://matrix-org.github.io/dendrite/development/contributing before
submitting your pull request -->

* [x] I have added Go unit tests or [Complement integration
tests](https://github.com/matrix-org/complement) for this PR _or_ I have
justified why this PR doesn't need tests
* [x] Pull request includes a [sign off
below](https://element-hq.github.io/dendrite/development/contributing#sign-off)
_or_ I have already signed off privately

Signed-off-by: `Vivianne Langdon <puttabutta@gmail.com>`

---------

Signed-off-by: Vivianne Langdon <puttabutta@gmail.com>
Co-authored-by: Kegan Dougal <7190048+kegsay@users.noreply.github.com>
2025-08-12 14:06:42 +01:00
..
helpers Update the license headers to mention the commercial license 2024-10-18 16:14:08 +02:00
input Adjust roomserver locks, don't unsubscribe if new event is inflight (#3588) 2025-08-12 14:06:42 +01:00
perform Room version 12 (#3623) 2025-08-11 20:59:47 +01:00
query Harmony backports (#3581) 2025-06-19 07:49:03 +00:00
alias.go Room version 12 (#3623) 2025-08-11 20:59:47 +01:00
api.go Rename the go package 2024-10-17 17:33:45 +02:00