Commit dedcca5c authored by dieter's avatar dieter

fix race condition

parent 59f4d209
...@@ -59,7 +59,7 @@ logging and event data: ...@@ -59,7 +59,7 @@ logging and event data:
>>> def event_handler(e): >>> def event_handler(e):
... if hasattr(e, 'storage'): ... if hasattr(e, 'storage'):
... events.append(( ... events.append((
... len(e.storage._server.client.cache), str(handler), e.__class__.__name__)) ... len(e.storage._cache), str(handler), e.__class__.__name__))
>>> old_notify = ZODB.event.notify >>> old_notify = ZODB.event.notify
>>> ZODB.event.notify = event_handler >>> ZODB.event.notify = event_handler
...@@ -75,12 +75,6 @@ Now, we'll restart the server on the original address: ...@@ -75,12 +75,6 @@ Now, we'll restart the server on the original address:
>>> wait_connected(db.storage) >>> wait_connected(db.storage)
##### debugging only ########
>>> print(db.storage._server.client.verify_result)
cache too old, clearing
>>> print(len(handler.records) > 1 and str(handler) + handler.records[0].exc_text)
False
Now, let's verify our assertions above: Now, let's verify our assertions above:
- Publishes a stale-cache event. - Publishes a stale-cache event.
...@@ -147,12 +141,6 @@ another client: ...@@ -147,12 +141,6 @@ another client:
(When a database is created, it checks to make sure the root object is (When a database is created, it checks to make sure the root object is
in the database, which is why we get 1, rather than 0 objects in the cache.) in the database, which is why we get 1, rather than 0 objects in the cache.)
##### debugging only ########
>>> print(db.storage._server.client.verify_result)
cache too old, clearing
>>> print(len(handler.records) > 1 and str(handler) + handler.records[0].exc_text)
False
- Publishes a stale-cache event. - Publishes a stale-cache event.
>>> for e in events: >>> for e in events:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment