mirror of
https://github.com/dragonflydb/dragonfly.git
synced 2025-05-10 18:05:44 +02:00
fix(server): client pause work while blocking commands run (#2584)
fix #2576 fix #2661 Signed-off-by: adi_holden <adi@dragonflydb.io>
This commit is contained in:
parent
8ef92629c5
commit
7e4527098b
7 changed files with 83 additions and 9 deletions
|
@ -1349,7 +1349,7 @@ OpStatus Transaction::WaitOnWatch(const time_point& tp, WaitKeysProvider wkeys_p
|
|||
auto* stats = ServerState::tl_connection_stats();
|
||||
++stats->num_blocked_clients;
|
||||
DVLOG(1) << "WaitOnWatch wait for " << tp << " " << DebugId();
|
||||
|
||||
// TBD set connection blocking state
|
||||
// Wait for the blocking barrier to be closed.
|
||||
// Note: It might return immediately if another thread already notified us.
|
||||
cv_status status = blocking_barrier_.Wait(tp);
|
||||
|
@ -1357,6 +1357,9 @@ OpStatus Transaction::WaitOnWatch(const time_point& tp, WaitKeysProvider wkeys_p
|
|||
DVLOG(1) << "WaitOnWatch done " << int(status) << " " << DebugId();
|
||||
--stats->num_blocked_clients;
|
||||
|
||||
// TBD set connection pause state
|
||||
ServerState::tlocal()->AwaitPauseState(true); // blocking are always write commands
|
||||
|
||||
OpStatus result = OpStatus::OK;
|
||||
if (status == cv_status::timeout) {
|
||||
result = OpStatus::TIMED_OUT;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue