Skip to content
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

Atomic Concurrency Checks #1231

ceturc opened this issue Mar 3, 2019 · 0 comments

Atomic Concurrency Checks #1231

ceturc opened this issue Mar 3, 2019 · 0 comments


Copy link

ceturc commented Mar 3, 2019

Expected Behavior

Multiple concurrent patches to the same record, from different processes, should result in at least one patch failing with a 412 error (Precondition Failed)

Minimal example will be submitted via a P/R test case shortly.

Actual Behavior

If multiple patch requests are both processed at the same time in different processes, multiple conflicting patches will succeed with a 200, resulting in data inconsistency.



Prior to commit 54fd697 from 2016-November, ETags would be verified
twice during a patch. One ETag check would be non-atomic by Eve,
then again atomically by MongoDB during
The atomic ETag check was removed during issue #920 in 54fd697

When running Eve in a scale-out environment (multiple processes),
concurrent simultaneous updates are sometimes allowed, because
the Python-only ETag check is not atomic.

There is a critical section in patch_internal() between get_document()
and where a competing Eve process can change the
document and ETag.

I am working on a pull request that contains a proposed patch and a simple
test case that simulates this situation and will upload it shortly.

Thank you.

Chuck Turco

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet

No branches or pull requests

2 participants