Possible race condition in TreeCache
leads to wrong sequence of cache events
#645
Labels
TreeCache
leads to wrong sequence of cache events
#645
There seems to be a race condition in the implementation of the
TreeCache
recipe where a wrong sequence ofTreeEvents
is delivered to the cache listener.Expected Behavior
The
TreeEvents
are delivered in order and with the correct event type and data.Actual Behavior
An update of a node immediately followed by a delete of that node can lead to a wrong sequence of
TreeEvents
.The race seems to happen as follows:
TreeNode._process_watch()
and triggers an async get.TreeNode._process_watch()
and publishes aTreeEvent.NODE_DELETED
event with the current (old) data/version and sets the data toNone
+ state toSTATE_DEAD
TreeNode_process_result()
and publishes aTreeEvent.NODE_ADDED
event with the data that was already deleted.The
NODE_ADDED
event seems to be created because the state was set toSTATE_DEAD
already.Snippet to Reproduce the Problem
The below script probably needs to be run multiple times in order to observe the described issue.
Logs with logging in DEBUG mode
Specifications
pip list
command:The text was updated successfully, but these errors were encountered: