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.
This commit is contained in:
zhaozhao.zz 2018-10-11 21:20:46 +08:00
parent 4dc48a0d11
commit 183ef7ae9b

View File

@ -2165,8 +2165,10 @@ void xclaimCommand(client *c) {
if (nack != raxNotFound) { if (nack != raxNotFound) {
/* We need to check if the minimum idle time requested /* We need to check if the minimum idle time requested
* by the caller is satisfied by this entry. */ * by the caller is satisfied by this entry.
if (minidle) { * 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; mstime_t this_idle = now - nack->delivery_time;
if (this_idle < minidle) continue; if (this_idle < minidle) continue;
} }