Hi everyone,

I am reporting this issue because I encountered a potential undefined behavior with the 'watch' command. Specifically, the problem occurs when a key might be deleted by another external operation before the 'watch' command is executed, yet this deletion doesn't result in an error within the 'watch' command. As a result, it leads to an undefined behavior to the succeeding commands. Let me clarify what I mean with the following example:

WATCH x <— x is deleted an instant before been watched, no error value = GET x <— return (nil), I expect that x always exists value++ MULTI SET x value EXEC

To conclude, I would like to inquire whether this behavior is intended or if it might be considered a bug.

(Sorry for my English is not my native language)

Best regards,

-Pasquale Celani

Comment From: yossigo

This is the expected behavior. The guarantee is that key x will not change between WATCH and EXEC, to let you operate on it atomically without creating a race condition.