• Julien Muchembled's avatar
    client: fix race condition between Storage.load() and invalidations · a2e278d5
    Julien Muchembled authored
    This fixes a bug that could manifest as follows:
    
      Traceback (most recent call last):
        File "neo/client/app.py", line 432, in load
          self._cache.store(oid, data, tid, next_tid)
        File "neo/client/cache.py", line 223, in store
          assert item.tid == tid, (item, tid)
      AssertionError: (<CacheItem oid='\x00\x00\x00\x00\x00\x00\x00\x01' tid='\x03\xcb\xc6\xca\xfd\xc7\xda\xee' next_tid='\x03\xcb\xc6\xca\xfd\xd8\t\x88' data='...' counter=1 level=1 expire=10000 prev=<...> next=<...>>, '\x03\xcb\xc6\xca\xfd\xd8\t\x88')
    
    The big changes in the threaded test framework are required because we need to
    reproduce a race condition between client threads and this conflicts with the
    serialization of epoll events (deadlock).
    a2e278d5
master.py 6.92 KB