You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now this is configured to wait up to five minutes for the lock, which seems like way too long, especially if a contact has a lot of pending messages that may cause us to lock up many threads waiting to get the lock.
We should explore whether we can just exit immediately and re-queue the handling. Message handling already processes all messages it can find for a contact at once so there isn't a real need to be so determined to get the lock here. Adding an extra contact handle event to the queue when we fail to get the lock should be no problem at all and gives our threads the opportunity to work on something else.
The text was updated successfully, but these errors were encountered:
So that we don't handle multiple messages at the same time for the same contact we make sure to get a lock before moving forward with handling it:
https://github.com/nyaruka/mailroom/blob/master/tasks/handler/worker.go#L98
Right now this is configured to wait up to five minutes for the lock, which seems like way too long, especially if a contact has a lot of pending messages that may cause us to lock up many threads waiting to get the lock.
We should explore whether we can just exit immediately and re-queue the handling. Message handling already processes all messages it can find for a contact at once so there isn't a real need to be so determined to get the lock here. Adding an extra contact handle event to the queue when we fail to get the lock should be no problem at all and gives our threads the opportunity to work on something else.
The text was updated successfully, but these errors were encountered: