mirror of https://mirror.osredm.com/root/redis.git
Fix coredump after Client Unpause command when threaded I/O is enabled (#9041)
Fix crash when using io-threads-do-reads and issuing CLIENT PAUSE and CLIENT UNPAUSE. This issue was introduced in redis 6.2 together with the FAILOVER command.
This commit is contained in:
parent
7900b48bc7
commit
096c5fd5d2
|
@ -3664,7 +3664,7 @@ int postponeClientRead(client *c) {
|
||||||
if (server.io_threads_active &&
|
if (server.io_threads_active &&
|
||||||
server.io_threads_do_reads &&
|
server.io_threads_do_reads &&
|
||||||
!ProcessingEventsWhileBlocked &&
|
!ProcessingEventsWhileBlocked &&
|
||||||
!(c->flags & (CLIENT_MASTER|CLIENT_SLAVE|CLIENT_PENDING_READ)))
|
!(c->flags & (CLIENT_MASTER|CLIENT_SLAVE|CLIENT_PENDING_READ|CLIENT_BLOCKED)))
|
||||||
{
|
{
|
||||||
c->flags |= CLIENT_PENDING_READ;
|
c->flags |= CLIENT_PENDING_READ;
|
||||||
listAddNodeHead(server.clients_pending_read,c);
|
listAddNodeHead(server.clients_pending_read,c);
|
||||||
|
@ -3728,6 +3728,7 @@ int handleClientsWithPendingReadsUsingThreads(void) {
|
||||||
c->flags &= ~CLIENT_PENDING_READ;
|
c->flags &= ~CLIENT_PENDING_READ;
|
||||||
listDelNode(server.clients_pending_read,ln);
|
listDelNode(server.clients_pending_read,ln);
|
||||||
|
|
||||||
|
serverAssert(!(c->flags & CLIENT_BLOCKED));
|
||||||
if (processPendingCommandsAndResetClient(c) == C_ERR) {
|
if (processPendingCommandsAndResetClient(c) == C_ERR) {
|
||||||
/* If the client is no longer valid, we avoid
|
/* If the client is no longer valid, we avoid
|
||||||
* processing the client later. So we just go
|
* processing the client later. So we just go
|
||||||
|
|
Loading…
Reference in New Issue