diff options
| author | 2020-11-10 18:30:37 +0100 | |
|---|---|---|
| committer | 2020-11-10 18:33:51 +0100 | |
| commit | 4b60c214804cb44610ff49f4bce3b8f2ffe5194c (patch) | |
| tree | 836eee6a5acf0f54057d804f1407d02d4e812143 /tests/_autospec.py | |
| parent | Voice Gate: define atomic `_delete_ping` function (diff) | |
Voice Gate: ensure atomicity when notifying users
Previously, the listener risked yielding control to a racing event at
multiple points between checking whether the member was already
notified, notifying them, and writing this information into the cache.
As a result, in a pathological case, multiple racing coroutines could
have passed the membership check and ping-spammed the user, before the
first coro could have a chance to write the message ID into the cache.
In this commit, we move this logic into an atomic helper, which will
ensure that events are processed one-by-one, and subsequent events
correctly abort.
Co-authored-by: MarkKoz <[email protected]>
Co-authored-by: Sebastiaan Zeeff <[email protected]>
Co-authored-by: Daniel Brown <[email protected]>
Diffstat (limited to 'tests/_autospec.py')
0 files changed, 0 insertions, 0 deletions