Skip to content

[BUG] redis-cli exit codes are inconsistent #10437

@tezc

Description

@tezc

Describe the bug

redis-cli exit code can be 1 or 255 on failure. Looks like it's inconsistent, not sure when to expect one or another.

To reproduce

This is how 255 is returned:

return noninteractive(argc,argv);

noninteractive() returns REDIS_ERR on failure, which is -1, it becomes 255 as exit codes are in range 0-255.

Expected behavior

As far as I see, nothing is wrong by doing this but it'd nice to be consistent. If we want to have a quick fix and use exit code 1 on all cases, we might be introducing a breaking change? I'm not sure if anybody relies on this.

Also, we had a quick conversation with @yossigo, we may further improve error codes by using different exit codes for different error cases as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions