You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The compare-and-set* function contains a bug that is hard to spot and can result in a failed compare and set to be compared as successful while it is not.
The problem is with this check
(some? (r/wcar conn
(r/multi)
(r/set k {:data newval})
(r/exec)))
The Carmine return for wcar will always be a vector ["OK" "QUEUED" x] where x is the return of the exec, which in turn would be a vector with the return of all queued transaction operations. If all goes well x will be ["OK"] and if the transaction fails, would be nil. So when the transaction fails, the return is ["OK" "QUEUED" nil], which obviously returns true when passed to some? when it should return false.
The text was updated successfully, but these errors were encountered:
The compare-and-set* function contains a bug that is hard to spot and can result in a failed compare and set to be compared as successful while it is not.
The problem is with this check
The Carmine return for
wcar
will always be a vector["OK" "QUEUED" x]
wherex
is the return of theexec
, which in turn would be a vector with the return of all queued transaction operations. If all goes wellx
will be["OK"]
and if the transaction fails, would benil
. So when the transaction fails, the return is["OK" "QUEUED" nil]
, which obviously returns true when passed tosome?
when it should return false.The text was updated successfully, but these errors were encountered: