• antirez's avatar
    Handle wait3() errors. · 1cc7a454
    antirez authored
    My guess was that wait3() with WNOHANG could never return -1 and an
    error. However issue #2897 may possibly indicate that this could happen
    under non clear conditions. While we try to understand this better,
    better to handle a return value of -1 explicitly, otherwise in the
    case a BGREWRITE is in progress but wait3() returns -1, the effect is to
    match the first branch of the if/else block since server.rdb_child_pid
    is -1, and call backgroundSaveDoneHandler() without a good reason, that
    will, in turn, crash the Redis server with an assertion.
    1cc7a454
server.c 157 KB