Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: move triggering actions out of transations (#3215)
When removing failing connection in SlackService, we used to trigger actions in the middle of a db transaction that is locking rows. We also do all sort of async operations like logging. If the actions for instance are experiencing any kind of issue, the transaction is kept open and waiting until the actions times out or the db cancels the transaction, holding the db connection during all this time. This commits moves the actual sending of the Slack notification after the db has been updated. We run into the risk of updating the db and not sending the notification but we cannot currently guarantee those operations to be fully atomic without potentially locking the db for a very long time. There might be a possibility to now reduce the transaction into a single atomic query but I didn't want this change to be too heavy right before the holidays
- Loading branch information