Summary
This issue documents the outcome of the investigation into whether valkey-glide should implement the DEBUG command as a first-class API, and explains how users who need it should proceed.
Background
The DEBUG command is an internal Valkey server command tagged @admin @dangerous @slow, described by Valkey itself as "an internal command meant for developing and testing Valkey." Sub-commands range from informational to catastrophic:
| Sub-command |
Risk |
SEGFAULT |
Crashes the server immediately |
SLEEP <seconds> |
Blocks the server event loop for N seconds |
RELOAD |
Forces a full RDB dump + reload |
CHANGE-REPL-ID |
Breaks replication |
OBJECT <key> |
Returns encoding, refcount, serialized-length — safe |
SET-ACTIVE-EXPIRE |
Controls lazy expiry behavior |
Precedent: jedis
jedis implemented DebugParams in 3.x, then deprecated and deleted it entirely in 4.x, citing the command's dangerous and internal nature. This is the clearest signal from the ecosystem.
Decision: Not implemented as glide command
valkey-glide does not and will not implement DEBUG as a typed public API method. Reasons:
- Dangerous surface area:
DEBUG SEGFAULT, DEBUG SLEEP, and DEBUG CHANGE-REPL-ID can crash or disrupt production systems. A typed client.debug(...) normalizes this.
- Blocked on managed cloud: AWS ElastiCache disables
DEBUG entirely — a first-class method would silently fail for a large portion of production users.
- No unique value: The only sub-command with practical application-developer value —
DEBUG OBJECT — is already accessible via the existing customCommand API.
How to use DEBUG if you need it
Use the customCommand (raw command) API available in all language clients:
# Python
await client.custom_command(["DEBUG", "OBJECT", "mykey"])
// Node.js / TypeScript
await client.customCommand(["DEBUG", "OBJECT", "mykey"]);
// Java
client.customCommand(new String[]{"DEBUG", "OBJECT", "mykey"}).get();
// Go
client.CustomCommand(ctx, []string{"DEBUG", "OBJECT", "mykey"})
⚠️ Warning: Sub-commands like DEBUG SEGFAULT, DEBUG SLEEP, and DEBUG CHANGE-REPL-ID can crash, hang, or corrupt your Valkey server. Only use them in controlled, non-production environments.
For valkey-glide internal test infrastructure
If glide's own integration test suite needs sub-commands like DEBUG SET-ACTIVE-EXPIRE (to force TTL expiry) or DEBUG SLEEP (to simulate latency), use customCommand within the test layer — no public API additions needed.
References
Summary
This issue documents the outcome of the investigation into whether valkey-glide should implement the
DEBUGcommand as a first-class API, and explains how users who need it should proceed.Background
The
DEBUGcommand is an internal Valkey server command tagged@admin @dangerous @slow, described by Valkey itself as "an internal command meant for developing and testing Valkey." Sub-commands range from informational to catastrophic:SEGFAULTSLEEP <seconds>RELOADCHANGE-REPL-IDOBJECT <key>SET-ACTIVE-EXPIREPrecedent: jedis
jedis implemented
DebugParamsin 3.x, then deprecated and deleted it entirely in 4.x, citing the command's dangerous and internal nature. This is the clearest signal from the ecosystem.Decision: Not implemented as glide command
valkey-glide does not and will not implement
DEBUGas a typed public API method. Reasons:DEBUG SEGFAULT,DEBUG SLEEP, andDEBUG CHANGE-REPL-IDcan crash or disrupt production systems. A typedclient.debug(...)normalizes this.DEBUGentirely — a first-class method would silently fail for a large portion of production users.DEBUG OBJECT— is already accessible via the existingcustomCommandAPI.How to use DEBUG if you need it
Use the
customCommand(raw command) API available in all language clients:For valkey-glide internal test infrastructure
If glide's own integration test suite needs sub-commands like
DEBUG SET-ACTIVE-EXPIRE(to force TTL expiry) orDEBUG SLEEP(to simulate latency), usecustomCommandwithin the test layer — no public API additions needed.References
DebugParamsremoval: redis/jedis#3803