Skip to content

Looks like simple CAS setup doesn't work #139

Description

I've tested simple CAS setup, two parallel python processes updating some key on single shared server:

  1. Set the key:
mc.set('k', 0)
  1. Run two processes with that code:
for x in range(10**5):
    while True:
        k = mc.gets('k')
        if mc.cas('k', k+1):
            break
  1. Read the key:
mc.get('k')
# some random number less than 2*10^5 (usually about 1.5*10^5)

The cas() call never failed.
Same test, but with cas() replaced by incr() always gives 2*10^5

Python 3.6.3, python-memcached==1.59, everything was inside docker-compose setup

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions