aboutsummaryrefslogtreecommitdiffstats
path: root/tests/_autospec.py
diff options
context:
space:
mode:
authorGravatar kwzrd <[email protected]>2020-11-10 18:30:37 +0100
committerGravatar kwzrd <[email protected]>2020-11-10 18:33:51 +0100
commit4b60c214804cb44610ff49f4bce3b8f2ffe5194c (patch)
tree836eee6a5acf0f54057d804f1407d02d4e812143 /tests/_autospec.py
parentVoice 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