Sidekiq Race Conditions [Chris Toomey]
Sidekiq Race Conditions [Chris Toomey]

Sidekiq Race Conditions [Chris Toomey]

Naty🤎

11 min
Comedy & EntertainmentCover
Play

Description

<p>Listen to The Bikeshed (24mins in) <a href="https://www.bikeshed.fm/313">https://www.bikeshed.fm/313</a></p><p><strong>Transcript</strong></p><p><br>So we had a bug that occurred in the application where something was supposed to have happened. And then there was an email that needed to go out to tell the user that this thing had happened. And the bug popped up within AppSignal and said something was nil that shouldn't have been nil.</p><p><br>Particularly, we're using a gem called Time For a Boolean, which is by Caleb Hearth. And he's a former thoughtboter and maintains this wonderful gem that instead of having a Boolean for like, is this thing approved, or is it paid? Or is it processed? You use a timestamp. And then this gem gives you nice Boolean-like methods on top of that timestamp. Because it turns out, very often just having the Boolean of like, this was paid, it turns out you really want to know when it was paid. That would be a really useful piece of information. And so, while you're still in Postgres land, it's nice to be able to reach for this and have the affordances of the Boolean-like interface but also have the timestamp where available.</p><p><br>So anyway, the email was trying to process but that timestamp...let's pretend that it was paid as the one that matters here so paid at was nil, which was very concerning. Because this was the email that's like, hey, that thing was processed. Or let's say it was processed, actually, because that's closer to what it was. Hey, this thing was processed, and here's an email notification to tell you that. But the process timestamp was nil. I was like, oh no. Oh no. And so when I saw this pop up, I was like, this is very bad. Everything is very bad. Oh goodness.</p><p><br>Turns out what had happened was...because I very quickly chased after this, looked in the background job queue, looked in Sidekiq's UI, and the job was gone. So it had been processed. I was like, wait a minute, how? How did this fix itself? Like, that's not the kind of bug that res

Uploader

tommy_reads

tommy_reads

Sidekiq Race Conditions [Chris Toomey] - Listen Free | WowFM