PragmaTwice commented on code in PR #2910:
URL: https://github.com/apache/kvrocks/pull/2910#discussion_r2066201867
##########
src/commands/blocking_commander.h:
##########
@@ -68,6 +69,15 @@ class BlockingCommander : public Commander,
}
void OnWrite(bufferevent *bev) {
+ {
+ // The blocking command should not be executed when the server is in
exclusive state,
+ // because it might have the data race when the server is in transaction
mode and run
+ // the callback here might cause the current execution also in
transaction mode.
+ //
+ // For more context, please refer to:
https://github.com/apache/kvrocks/issues/2900
+ auto concurrency = conn_->GetServer()->WorkConcurrencyGuard();
Review Comment:
It will be destructed immediately if we put it here, we can put it before
`auto guard = GetLocks();`.
##########
src/commands/blocking_commander.h:
##########
@@ -68,6 +69,15 @@ class BlockingCommander : public Commander,
}
void OnWrite(bufferevent *bev) {
+ {
+ // The blocking command should not be executed when the server is in
exclusive state,
+ // because it might have the data race when the server is in transaction
mode and run
+ // the callback here might cause the current execution also in
transaction mode.
+ //
+ // For more context, please refer to:
https://github.com/apache/kvrocks/issues/2900
+ auto concurrency = conn_->GetServer()->WorkConcurrencyGuard();
Review Comment:
It will be destructed immediately if we put it here, so we can move it
before `auto guard = GetLocks();`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]