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

@@ -192,7 +192,14 @@ func MakeBulk(data []byte) []byte {
if data == nil {
return []byte("$-1" + CRLF)
}
return []byte("$" + strconv.Itoa(len(data)) + CRLF + string(data) + CRLF)
// Build directly to avoid string conversion
b := make([]byte, 0, len(data)+len("$1000000000\r\n\r\n"))
b = append(b, '$')
b = strconv.AppendInt(b, int64(len(data)), 10)
b = append(b, CRLF...)
b = append(b, data...)
b = append(b, CRLF...)
return b
}
// MakeMultiBulk creates a RESP array from Value slices - used for pub/sub messages.