Skip to content

Back to database-based mutex locks#14102

Merged
brandonkelly merged 10 commits into4.6from
feature/cms-1224-database-mutex-driver
Jan 4, 2024
Merged

Back to database-based mutex locks#14102
brandonkelly merged 10 commits into4.6from
feature/cms-1224-database-mutex-driver

Conversation

@brandonkelly
Copy link
Copy Markdown
Member

@brandonkelly brandonkelly commented Jan 3, 2024

craft\mutex\Mutex now sets $this->mutex to one of the database mutex drivers by default, so mutex locks can support load-balanced and multi-OS environments out of the box.

This isn’t the first time we’ve taken this approach: we used database mutexes from craft 3.5.0 - 3.7.29 as well, however we went back to FileMutex in 3.7.30 due to MySQL’s erratic locking behavior when locks are used within transactions (#10189).

The key difference now is that MysqlMutex/PgsqlMutex will be configured to a dedicated database connection, avoiding those issues.

@linear
Copy link
Copy Markdown

linear Bot commented Jan 3, 2024

@brandonkelly brandonkelly merged commit 5d4acd1 into 4.6 Jan 4, 2024
@brandonkelly brandonkelly deleted the feature/cms-1224-database-mutex-driver branch January 4, 2024 21:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant