-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reduce likelihood of collection deadlocks
Fix an issue where concurrent calls to transfer_from() in Prompt Processing were causing Postgres to abort with a deadlock error. We now register collection names in alphabetical order when multiple collections are registered in a single transaction. Because `ButlerCollections.register()` inserts rows into a table with a unique index, Postgres takes a lock when the row is inserted and holds it until the end of the transaction. If there are two processes with concurrent transactions attempting to create the same collections, it is possible for the locks to be acquired in different orders, causing a deadlock.
- Loading branch information
Showing
2 changed files
with
31 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters