From 7f5c356371a93d88f1559e9b64231b44e3b15514 Mon Sep 17 00:00:00 2001 From: Nedyalko Dyakov Date: Thu, 23 Jan 2025 14:47:28 +0200 Subject: [PATCH] fix(command): add missing `io-thread` key in `client info` (#3244) * Add 8.0m3 image in docker compose * Add new key `io-thread` in client info Redis 8.0 introduces new key `io-thread` in the response for client info. The key needs to be parsed. If an unknown key is observed, the client will return an error. * improve readibility * Revert "Add 8.0m3 image in docker compose" This reverts commit 787c41f42917fb7d3ca3471d9941304695a9b3c8. * add dockers directory to gitignore --- .gitignore | 3 ++- command.go | 3 +++ main_test.go | 3 ++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 6f868895..7507584f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ +dockers/ *.rdb testdata/* .idea/ .DS_Store *.tar.gz -*.dic \ No newline at end of file +*.dic diff --git a/command.go b/command.go index 3cb9538a..f5aad914 100644 --- a/command.go +++ b/command.go @@ -5114,6 +5114,7 @@ type ClientInfo struct { OutputListLength int // oll, output list length (replies are queued in this list when the buffer is full) OutputMemory int // omem, output buffer memory usage TotalMemory int // tot-mem, total memory consumed by this client in its various buffers + IoThread int // io-thread id Events string // file descriptor events (see below) LastCmd string // cmd, last command played User string // the authenticated username of the client @@ -5292,6 +5293,8 @@ func parseClientInfo(txt string) (info *ClientInfo, err error) { info.LibName = val case "lib-ver": info.LibVer = val + case "io-thread": + info.IoThread, err = strconv.Atoi(val) default: return nil, fmt.Errorf("redis: unexpected client info key(%s)", key) } diff --git a/main_test.go b/main_test.go index 44f8e682..9f99b5c9 100644 --- a/main_test.go +++ b/main_test.go @@ -118,7 +118,8 @@ var _ = BeforeSuite(func() { sentinelSlave2Port, "--slaveof", "127.0.0.1", sentinelMasterPort) Expect(err).NotTo(HaveOccurred()) - Expect(startCluster(ctx, cluster)).NotTo(HaveOccurred()) + err = startCluster(ctx, cluster) + Expect(err).NotTo(HaveOccurred()) } else { redisPort = rediStackPort redisAddr = rediStackAddr