diff options
author | zhaozhao.zz <zhaozhao.zz@alibaba-inc.com> | 2018-10-11 21:20:46 +0800 |
---|---|---|
committer | zhaozhao.zz <zhaozhao.zz@alibaba-inc.com> | 2018-10-11 21:20:49 +0800 |
commit | 183ef7ae9bbc91d3bba0735df1669e95dc53a24e (patch) | |
tree | 079e0a6d4728dc0690a9e60d95e3e03392183bf9 /src/t_stream.c | |
parent | 4dc48a0d11fb7765a1a9b7a5908d9c9e64c10b8e (diff) | |
download | redis-183ef7ae9bbc91d3bba0735df1669e95dc53a24e.tar.gz |
Streams: XCLAIM ignore minidle if NACK is created by FORCE
Because the NACK->consumer is NULL, if idletime < minidle
the NACK does not belong to any consumer, then redis will crash
in XPENDING.
Diffstat (limited to 'src/t_stream.c')
-rw-r--r-- | src/t_stream.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/t_stream.c b/src/t_stream.c index ff95132c7..323783a7f 100644 --- a/src/t_stream.c +++ b/src/t_stream.c @@ -2165,8 +2165,10 @@ void xclaimCommand(client *c) { if (nack != raxNotFound) { /* We need to check if the minimum idle time requested - * by the caller is satisfied by this entry. */ - if (minidle) { + * by the caller is satisfied by this entry. + * Note that if nack->consumer is NULL, means the NACK + * is created by FORCE, we should ignore minidle. */ + if (nack->consumer && minidle) { mstime_t this_idle = now - nack->delivery_time; if (this_idle < minidle) continue; } |