1
0
mirror of https://github.com/redis/go-redis.git synced 2025-10-18 22:08:50 +03:00

fix: pipeline repeatedly sets the error (#3525)

* fix: pipeline repeatedly sets the error

Signed-off-by: Xiaolong Chen <fukua95@gmail.com>

* add test

Signed-off-by: Xiaolong Chen <fukua95@gmail.com>

* CI

Signed-off-by: Xiaolong Chen <fukua95@gmail.com>

---------

Signed-off-by: Xiaolong Chen <fukua95@gmail.com>
Co-authored-by: Nedyalko Dyakov <1547186+ndyakov@users.noreply.github.com>
This commit is contained in:
cxljs
2025-09-17 22:32:24 +08:00
committed by Nedyalko Dyakov
parent 7706f88cea
commit 33c70b2f4c
2 changed files with 37 additions and 1 deletions

View File

@@ -630,7 +630,10 @@ func (c *baseClient) generalProcessPipeline(
return err
})
if lastErr == nil || !canRetry || !shouldRetry(lastErr, true) {
setCmdsErr(cmds, lastErr)
// The error should be set here only when failing to obtain the conn.
if !isRedisError(lastErr) {
setCmdsErr(cmds, lastErr)
}
return lastErr
}
}