Getting Deadlock in MySQLSelectForUpdateBasedProxyManager.tryInsertEmptyData method #497
-
We are using Bucket4j to implement throttling in our microservice. Recently we noticed few requests failed for deadlock in the library. After initial diagnosis we found out its coming from MySQLSelectForUpdateBasedProxyManager.tryInsertEmptyData () method.
Any help is much appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Hello @saikatkar
|
Beta Was this translation helpful? Give feedback.
Hello @saikatkar
You use MySQLSelectForUpdateBasedProxyManager with MariaDB JDBC driver. This configuration was never tested because, there is dedicated integration for MariaDB try to switch to this dependency if you use MariaDb.
How did you activate Gap locking? Did you configure configure default transaction level at datasource levele that deffers from
READ COMMITTED
? If so, that looks that I need to add loggic to MySQLSelectForUpdateBasedProxyManager that will be responsible to setREAD COMMITTED
isolation level(that explicitly disables gap locking) after taking connection from datasource, and restore previous isolation level before returning transaction to datasource.