Skip to content

Always exit if connection fails.#895

Merged
antirez merged 1 commit intoredis:unstablefrom
badboy:catch_con_error
Jan 19, 2013
Merged

Always exit if connection fails.#895
antirez merged 1 commit intoredis:unstablefrom
badboy:catch_con_error

Conversation

@badboy
Copy link
Contributor

@badboy badboy commented Jan 18, 2013

This avoids unnecessary core dumps. Fixes antirez/redis#894

This avoids unnecessary core dumps. Fixes antirez/redis#894
antirez added a commit that referenced this pull request Jan 19, 2013
redis-cli: always exit if connection fails.
@antirez antirez merged commit 74f1373 into redis:unstable Jan 19, 2013
@antirez
Copy link
Contributor

antirez commented Jan 19, 2013

Thanks, merged.

@badboy badboy deleted the catch_con_error branch January 19, 2013 10:06
sundb pushed a commit to sundb/redis that referenced this pull request Jul 28, 2025
In standalone mode, when a `-REDIRECT` error occurs, special handling is
required if the client is in the `MULTI` context.

We have adopted the same handling method as the cluster mode:

1. If a command in the transaction encounters a `REDIRECT` at the time
of queuing, the execution of `EXEC` will return an `EXECABORT` error (we
expect the client to redirect and discard the transaction upon receiving
a `REDIRECT`). That is:

    ```
    MULTI    ==>  +OK
    SET x y  ==>  -REDIRECT
    EXEC     ==>  -EXECABORT
    ```
2. If all commands are successfully queued (i.e., `QUEUED` results are
received) but a redirect is detected during `EXEC` execution (such as a
primary-replica switch), a `REDIRECT` is returned to instruct the client
to perform a redirect. That is:

    ```
    MULTI    ==>  +OK
    SET x y  ==>  +QUEUED
    failover
    EXEC     ==>  -REDIRECT
    ```

---------

Signed-off-by: zhaozhao.zz <[email protected]>
minchopaskal pushed a commit to minchopaskal/redis that referenced this pull request Oct 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

redis-cli --rdb core dumps when it can't connect.

2 participants