New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OptimisticPipelineHook throws invalid ConcurrencyExceptions with IPersistStreams.Purge #332
Comments
Oh man... and I was just about to release it ha |
Is a workaround to recreate the IStoreEvents viable? |
Yes, that is of course a workaround, although it's cumbersome (we currently use a singleton BTW, I've just noticed that the new I guess the right way to fix it would be to add hook extension points for |
Am considering that but feels kinda leaky and I haven't come up with a cleaner way yet. I'll spike it and see what it looks like. |
@fschmied Would appreciate a review of the PR, you've got a good eye for detail 😄 |
@damianh I took the time today to look deeper into the code as I'm back to a real computer now, and I've found another interesting spot: it seems that the bug was originally caused not only by the fact that
As you can see, most read operations execute the hooks and thus cause the optimistic hook cache to be refreshed, but the I therefore believe that changing that overload to execute the hooks would also fix the cache issue, with the additional benefit of also working if another client deletes a stream. What do you think? |
Looks like a bug alright. |
Created seperate issue. |
We just ran into an issue in our integration tests, where
IEventStream.CommitChanges
throws aConcurrencyException
although there are no concurrent modifications (and indeed no commits in the database). Debugging showed that the exceptions are thrown byOptimisticPipelineHook.PreCommit
- the "heads" stored by the hook did not match what was in the database.The reason is that our tests use
IPersistStreams.Purge
to clear the event store, and theOptimisticPipelineHook
doesn't clear its cache when that API is called.The text was updated successfully, but these errors were encountered: