8000 Replace mutexQueuePeek with current_job field for BIO memcheck fix by asagege · Pull Request #18 · JimB123/valkey · GitHub
[go: up one dir, main page]

Skip to content

Replace mutexQueuePeek with current_job field for BIO memcheck fix - #18

Merged
JimB123 merged 1 commit into
JimB123:unstablefrom
asagege:alina_bio_fix
Feb 25, 2026
Merged

JimB123 merged 1 commit into
JimB123:unstablefrom
asagege:alina_bio_fix

Conversation

@asagege
@asagege asagege commented Feb 25, 2026
Copy link
Copy Markdown

The peek-then-pop pattern introduced in valkey-io#3178 solved the valgrind
false-positive leak report (https://github.com/valkey-io/valkey/actions/runs/21969557125/job/63467641572#step:6:8648) for in-flight BIO jobs, but peek is a
problematic API on a mutex queue: multiple readers can peek the same
item, and one reader can pop what another peeked.

Instead, store the in-flight job pointer in bio_worker_data.current_job
before processing and clear it after freeing. Since bio_workers[] is a
static array, valgrind can always trace from global memory to the job
allocation, even after the worker thread is cancelled.

Remove mutexQueuePeek from mutexqueue.{c,h} and its test.

Signed-off-by: Alina Liu <liusalisa6363@gmail.com>
@JimB123
JimB123 merged commit 16649c0 into JimB123:unstable Feb 25, 2026
56 checks passed
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.

2 participants

0