A blocked client that is woken but loses the element to another client is never woken again

Aperta
#3,762 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@ggyuchive ci sta già lavorando.

Dal 7/11/2026.

  • #3763 di @ggyuchive — aperta

Valutazione

Difficoltà
4/5
Tempo stimato
1-2 giorni
Idoneità per principianti
55/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
cpp, redis
Ambito
backend, databases

Direzione di ricerca

Start by tracing the blocking list pop and wakeup flow described in the reproduction, especially WakeupBlockingConns and the client's write callback. Reproduce with two connections using the listed transaction, then inspect the blocking connection handling when the element is gone by the time its callback runs. Done when the blocked client receives y after the later RPUSH and the list is empty.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug
Search before asking
  • I had searched in the issues and found no similar issues.
Version

Kvrocks unstable at commit c256cc6e31

Minimal reproduce step

Start an empty server and use two connections, A and B.

A> BLPOP k 0
B> MULTI
B> RPUSH k x
B> LPOP k
B> EXEC
B> RPUSH k y
B> LLEN k
What did you expect to see?
A> BLPOP k 0
(blocked)
B> MULTI
OK
B> RPUSH k x
QUEUED
B> LPOP k
QUEUED
B> EXEC
1) (integer) 1
2) "x"
B> RPUSH k y
(integer) 1
A: 1) "k"
   2) "y"
B> LLEN k
(integer) 0

A stays blocked through the transaction and gets y.

What did you see instead?
A> BLPOP k 0
(blocked)
B> MULTI
OK
B> RPUSH k x
QUEUED
B> LPOP k
QUEUED
B> EXEC
1) (integer) 1
2) "x"
B> RPUSH k y
(integer) 1
A: (no reply)
B> LLEN k
(integer) 1

A never gets a reply, although y stays in the list.

Anything Else?
sequenceDiagram
    participant A as Client A
    participant S as Kvrocks
    participant B as Client B
    A->>S: BLPOP k 0
    Note over S: k is empty, A is added to blocking_keys_[k]
    B->>S: MULTI / RPUSH k x / LPOP k / EXEC
    Note over S: RPUSH k x calls WakeupBlockingConns:<br/>A is removed from blocking_keys_[k] (pop_front)<br/>and its write event is enabled
    Note over S: LPOP k takes x
    S-->>B: 1) (integer) 1 2) "x"
    Note over S: A's write callback runs after EXEC:<br/>nothing to pop, the write event is disabled,<br/>but A is not added back to blocking_keys_[k]
    B->>S: RPUSH k y
    Note over S: blocking_keys_[k] is empty, nobody is woken
    S-->>B: (integer) 1
    Note over A: blocked forever, y stays in k
Are you willing to submit a PR?
  • I'm willing to submit a PR!
Lingua principale
C++
Stelle
4.5k
Fork
689
Merge medio
2g 1h
PR unite (30g)
35

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

  • Include un Dockerfile o un file Docker Compose
  • Nessun modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di apache/kvrocks

Tutte le issue di apache/kvrocks

Issue simili

Altre issue su C++

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.