Replies: 1 comment 2 replies
-
Good story about the race and concurrently modifying instance variables over the same instance! |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey all,
(First off, this issue was 100% our fault and it's not a bug in RES. But I'm posting this here in case anyone runs into the same problem)
We were migrating some of our existing code to RES and in one of the handlers ended up with something like (simplified):
The event handler is instantiated once, when app initializes:
Normally, this wouldn't be a problem, but we have a bunch of Sidekiq jobs that fire up exactly at 8am each day and run concurrently. Because there's only 1 instance of this handler, we started sending emails randomly to wrong people...
This is one of those "duh, of course" bugs (in hindsight), but just wanted to put it out there.
We added custom Rubocop rules to avoid repeating this bug. Feel free to steal:
Beta Was this translation helpful? Give feedback.
All reactions