郭伟光 fae5b1a19d
unblockClient: avoid to reset client when the client was shutdown-blocked (#10440)
fix #10439. see https://github.com/redis/redis/pull/9872
When executing SHUTDOWN we pause the client so we can un-pause it
if the shutdown fails.
this could happen during the timeout, if the shutdown is aborted, but could
also happen from withing the initial `call()` to shutdown, if the rdb save fails.
in that case when we return to `call()`, we'll crash if `c->cmd` has been set to NULL.

The call stack is:
```
unblockClient(c)
replyToClientsBlockedOnShutdown()
cancelShutdown()
finishShutdown()
prepareForShutdown()
shutdownCommand()
```

what's special about SHUTDOWN in that respect is that it can be paused,
and then un-paused before the original `call()` returns.
tests where added for both failed shutdown, and a followup successful one.
2022-03-20 15:18:53 +02:00
..
2022-03-09 13:55:17 +02:00
2020-04-24 17:11:21 -07:00
2022-03-09 13:58:23 +02:00
2021-12-19 17:52:23 +02:00
2022-02-28 10:59:16 +02:00
2020-10-27 15:04:18 +02:00
2022-01-06 13:39:38 +02:00
2022-03-09 13:58:23 +02:00
2022-03-09 13:58:23 +02:00
2020-05-05 23:35:08 -04:00
2022-01-06 17:59:37 +02:00
2022-01-02 16:54:47 -08:00
2022-03-09 13:58:23 +02:00
2021-07-10 10:04:54 -05:00
2020-07-21 08:13:05 +03:00
2022-03-09 13:58:23 +02:00