Closed GoogleCodeExporter closed 8 years ago
I will investigate
Original comment by marc.gravell
on 26 Apr 2013 at 2:53
I will investigate
Original comment by marc.gravell
on 26 Apr 2013 at 2:53
I will try to repro - if I could use your *actual* code that reproduces this it
would be handy, but I have a suspicion the error is not *necessarily* what you
think it is. In particular, there are *other* reasons a transaction can be
aborted *even if all the preconditions are met* - specifically, if another
connection touches any of the WATCH keys for the transaction, then the
transaction will be aborted. This is simply how redis transactions are
implemented. The pre-conditions take out WATCH keys to ensure that the
pre-condition doesn't *become false silently* between the check and the
execution.
---
For info, I believe the "It looks like only the result of the last condition's
task is waited for" is a red-herring; the point here is that these tasks are
known not to have continuations (since they are only used internally to the
library), so the code uses:
msg.ForceSync();
on each; this means that the callbacks are executed *in order* directly on the
reader-thread. So it waits for the last one simply because if the last one has
a response then they *all* have their responses (order of commands/responses is
retained by redis). If you notice, *after* it has waited, it then asks each
condition separately whether it got the response it wanted:
foreach (var cond in conditions)
{
if (!cond.Validate()) return false;
}
return true;
In the case of KeyExists, this is basically querying whether `EXISTS` returns 1
/ 0.
Original comment by marc.gravell
on 26 Apr 2013 at 6:25
Edit: I have a successful repro - investigating, thanks - definitely something
wrong here - sorry if I sounded dubious, but I like to think about things
before diving in!
Original comment by marc.gravell
on 26 Apr 2013 at 6:32
And indeed, the TaskStatus is WaitingForActivation; the real error was
CreateMessages() in ExistsCondition - should have specified
ExecuteSynchronously - my mistake, sorry. Fixing.
Original comment by marc.gravell
on 26 Apr 2013 at 6:46
Fixed in 1.3.35
Original comment by marc.gravell
on 26 Apr 2013 at 6:53
Original issue reported on code.google.com by
g...@stylelabs.com
on 26 Apr 2013 at 1:12