• Oran Agra's avatar
    Fix rejectCommand trims newline in shared error objects, hung clients (#7714) · 9fcd9e19
    Oran Agra authored
    65a3307b
    
     (released in 6.0.6) has a side effect, when processCommand
    rejects a command with pre-made shared object error string, it trims the
    newlines from the end of the string. if that string is later used with
    addReply, the newline will be missing, breaking the protocol, and
    leaving the client hung.
    
    It seems that the only scenario which this happens is when replying with
    -LOADING to some command, and later using that reply from the CONFIG
    SET command (still during loading). this will result in hung client.
    
    Refactoring the code in order to avoid trimming these newlines from
    shared string objects, and do the newline trimming only in other cases
    where it's needed.
    Co-authored-by: default avatarGuy Benoish <guy.benoish@redislabs.com>
    9fcd9e19
multi.c 13.7 KB