Bugfixes, add INFO command, graceful shutdown. elimitate dead code

- Remove unsed handleClientKill, handleClientKill
- Fix misleading error message on rate limit
- Eliminated unused channel-to-pattern index that was causing unnecessary work
- Fixed O(n²) duplicate check in PublishToPattern
- Limit total pattern subscriptions to 10,000
- Limit channel subscriptions per client to 10,000
- Added INFO command
- Added graceful shutdown timeout
- Validate that log directory is writable during config load
- Make SELECT properly handle whitespace around DB index like Redis
- Return proper error instead of empty array for unsupported commands on sharded pubsub stubs
- More accurate error messages throughout
- Updated README.md
This commit is contained in:
eleksir
2026-04-03 10:01:29 +03:00
parent 92cd652b0d
commit 488ce1e4d1
9 changed files with 321 additions and 115 deletions

View File

@@ -153,6 +153,7 @@ On Linux, macOS, and BSD, if `--config` is given the specified file is used dire
| `log_level` | string | `"info"` | Logging level: debug, info, warn, error |
| `log_file` | string | `""` | Log file path (empty = stdout only) |
| `pid_file` | string | `""` | PID file path (empty = no PID file) |
| `shutdown_timeout` | int | `30` | Graceful shutdown timeout in seconds (0 = wait forever) |
If you don't provide a config file, sensible defaults are used.
@@ -246,6 +247,26 @@ PING hello
# Returns: +hello
```
### SELECT
Switch to a different database (0-15). In Pekoe this is a no-op since there's no persistent data, but it maintains client compatibility.
```bash
SELECT 5
# Returns: +OK
```
### INFO
Returns comprehensive server information in Redis-compatible format.
```bash
INFO
# Returns: # Server\r\nredis_version:...\r\n...
```
Returns sections: Server, Clients, Memory, Persistence, Stats, Replication, CPU, Keyspace.
### PUBSUB
Introspection commands for monitoring:
@@ -418,8 +439,11 @@ Test coverage includes:
- Basic SUBSCRIBE/PUBLISH/UNSUBSCRIBE
- Pattern PSUBSCRIBE/PUNSUBSCRIBE with wildcards
- Multiple channel/pattern subscriptions
- PUBSUB NUMSUB, CHANNELS, NUMPAT commands
- PUBSUB NUMSUB, CHANNELS, NUMPAT, SHARDCHANNELS, SHARDNUMSUB, HELP commands
- PING command (with and without message)
- SELECT database switching (for client compatibility)
- INFO server information
- CLIENT ID, SETNAME, GETNAME, LIST, INFO, KILL, PAUSE, REPLY commands
- Binary-safe messages
- Empty and long messages
- Unicode content