• 郭伟光's avatar
    unblockClient: avoid to reset client when the client was shutdown-blocked (#10440) · fae5b1a1
    郭伟光 authored
    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.
    fae5b1a1
shutdown.tcl 3.41 KB