-
Notifications
You must be signed in to change notification settings - Fork 2
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
This was observed with the WIP automod extension. If a user sends a command that causes a write operation (such as adding a rule), there will be a race condition between the command handler and any rules that are listening for send_message event.
My guess it that these are two separate asyncio tasks running concurrently, and each one hits the get_cache() method independently. Whoever's second will cause self.__cache to overwrite itself.
Assuming these are indeed separate asyncio tasks, the solution should be as simple as surrounding the critical portion of get_cache() method with a lock so that only a single task is ever evaluating and/or initializing __cache at any given time.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working