Skip to content

Understanding filter predicates and a possible race condition? #1534

Answered by sjbodzo
sjbodzo asked this question in Q&A
Discussion options

You must be logged in to vote

@ivan-kiselev identified our root issue.

The first time a new object is seen, it does not have a finalizer set. Therefore the code will attempt to patch the object and await_change. Patching the object does not increment the object's generation so our predicate filter then prevents the object from triggering the controller. This is because the initial trigger caused generation = 1 to already be seen.

Restarting the controller instance fixed the problem by presenting a new store to cache.

The solution implemented was to write a custom predicate filter on K that inputs the hash of the generation (if present) and then adds in the hash of the finalizers:

pub fn generation_and_finalizers<K: Re…

Replies: 1 comment 9 replies

Comment options

You must be logged in to vote
9 replies
@clux
Comment options

@sjbodzo
Comment options

@clux
Comment options

@sjbodzo
Comment options

Answer selected by sjbodzo
@clux
Comment options

@ivan-kiselev
Comment options

@ivan-kiselev
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants