mirror of
https://github.com/redis/go-redis.git
synced 2025-04-19 07:22:17 +03:00
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
This commit is contained in:
parent
efe0f65bf0
commit
94b88f5ab2
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,3 +1,4 @@
|
|||||||
|
dockers/
|
||||||
*.rdb
|
*.rdb
|
||||||
testdata/*
|
testdata/*
|
||||||
.idea/
|
.idea/
|
||||||
|
@ -5114,6 +5114,7 @@ type ClientInfo struct {
|
|||||||
OutputListLength int // oll, output list length (replies are queued in this list when the buffer is full)
|
OutputListLength int // oll, output list length (replies are queued in this list when the buffer is full)
|
||||||
OutputMemory int // omem, output buffer memory usage
|
OutputMemory int // omem, output buffer memory usage
|
||||||
TotalMemory int // tot-mem, total memory consumed by this client in its various buffers
|
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)
|
Events string // file descriptor events (see below)
|
||||||
LastCmd string // cmd, last command played
|
LastCmd string // cmd, last command played
|
||||||
User string // the authenticated username of the client
|
User string // the authenticated username of the client
|
||||||
@ -5292,6 +5293,8 @@ func parseClientInfo(txt string) (info *ClientInfo, err error) {
|
|||||||
info.LibName = val
|
info.LibName = val
|
||||||
case "lib-ver":
|
case "lib-ver":
|
||||||
info.LibVer = val
|
info.LibVer = val
|
||||||
|
case "io-thread":
|
||||||
|
info.IoThread, err = strconv.Atoi(val)
|
||||||
default:
|
default:
|
||||||
return nil, fmt.Errorf("redis: unexpected client info key(%s)", key)
|
return nil, fmt.Errorf("redis: unexpected client info key(%s)", key)
|
||||||
}
|
}
|
||||||
|
@ -118,7 +118,8 @@ var _ = BeforeSuite(func() {
|
|||||||
sentinelSlave2Port, "--slaveof", "127.0.0.1", sentinelMasterPort)
|
sentinelSlave2Port, "--slaveof", "127.0.0.1", sentinelMasterPort)
|
||||||
Expect(err).NotTo(HaveOccurred())
|
Expect(err).NotTo(HaveOccurred())
|
||||||
|
|
||||||
Expect(startCluster(ctx, cluster)).NotTo(HaveOccurred())
|
err = startCluster(ctx, cluster)
|
||||||
|
Expect(err).NotTo(HaveOccurred())
|
||||||
} else {
|
} else {
|
||||||
redisPort = rediStackPort
|
redisPort = rediStackPort
|
||||||
redisAddr = rediStackAddr
|
redisAddr = rediStackAddr
|
||||||
|
Loading…
x
Reference in New Issue
Block a user