-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Solution (#4143): [BUG] Tracking table items not cleaned after client disconnect #4163
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: unstable
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| #ifndef TRACKING_H | ||
| #define TRACKING_H | ||
|
|
||
| #include "deps/jemalloc/include/jemalloc/internal/arena_structs.h" | ||
|
|
||
| struct tracking_table { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This header is dead code: no file includes it, |
||
| struct arena *arena; | ||
| }; | ||
|
|
||
| void tracking_table_defragment(struct tracking_table *table); | ||
| void tracking_table_sweep_dead_clients(struct tracking_table *table); | ||
| void tracking_table_periodic_sweep(struct tracking_table *table); | ||
|
Comment on lines
+4
to
+12
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: #!/bin/bash
rg -n '\b(struct arena|struct arena_s|arena_t|tracking_table)\b' .Repository: valkey-io/valkey Length of output: 25920 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "== file c =="
cat -n c
echo
echo "== jemalloc arena typedefs =="
sed -n '1,80p' deps/jemalloc/include/jemalloc/internal/arena_types.h
echo
echo "== jemalloc arena structs =="
sed -n '1,80p' deps/jemalloc/include/jemalloc/internal/arena_structs.hRepository: valkey-io/valkey Length of output: 4922 Use
🤖 Prompt for AI AgentsSource: MCP tools |
||
|
|
||
| #endif /* TRACKING_H */ | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This pulls in a jemalloc internal header. jemalloc's
struct arena_sis a memory-allocator arena and has no relation to the client tracking table. It is also not includable from server code: the path is relative to the repo root (server sources build fromsrc/without a repo-root include path), the header chains into a dozen otherjemalloc/internal/*headers that require jemalloc's configure-generated definitions (jemalloc_internal_defs.hdoes not exist until the dep is built), and Valkey supportsMALLOC=libcbuilds where jemalloc isn't configured at all. Any state the tracking cleanup needs belongs insrc/tracking.c's own structures, not indeps/.