Mutex for ActiveRecord - why not use built-in with_lock? #11490
Replies: 2 comments
-
@ksouthworth I believe we couldn't lock the conversation in this as we would other actions being performed at the same time. @scmmishra could add more. |
Beta Was this translation helpful? Give feedback.
-
Hey there, in our case the conversation record isn’t even created in the first place, so the issue would still show up. Typically advisory locks can be used in these scenarios, but even that won’t work well since the unique constraints are not granular enough. This typically rises from the fact that a conversation thread on Instagram can potentially correspond to multiple threads on Chatwoot. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I was reading your blog about your
Redis::LockManager
class implementation. I'm assuming you tried the built-in Rails Locking methods and those were not sufficient for your requirements?E.g. using your blog example of a conversation with near-simultaneous messages coming in:
Beta Was this translation helpful? Give feedback.
All reactions