pico-engine icon indicating copy to clipboard operation
pico-engine copied to clipboard

Need better isolation between rulesets when performing wrangler operations

Open b1conrad opened this issue 2 years ago • 5 comments

Wrangler operations are initiated with events specified in a ruleset. When the operation completes, Wrangler usually raises an event reporting completion. The ruleset often has rules that select on these completion events.

Other rulesets also get a chance to select rules on the completion event. This can easily break isolation between rulesets in the same pico.

A common idiom used in this regard is

  select when wrangler ruleset_installed where rids >< meta:rid

In this case, the operation was initiated in a different ruleset, but its completion is of interest only to the ruleset that has just been installed.

The usage of a correlation identifier is documented in "Managing Pico Lifecycle" in the sections "Creating a Pico" and "Deleting a Pico".

b1conrad avatar Jul 05 '22 16:07 b1conrad

For this to work, every rule in Wrangler needs to pass through all of the event attributes that it receives, as it cannot know about correlation identifiers that might be included in them.

In particular, the child_initiates_deletion rule needs to forward any incoming attributes, along with the one it constructs for its purpose.

b1conrad avatar Jul 05 '22 18:07 b1conrad

There are some cases where an event is sent rather than raised. In particular, where we are crossing over from the child's perspective to the parent's and vice versa.

For example, byu.hr.oit sends an event to a child pico (so that it won't happen until well after the previous event that it sent to that same pico has finished) which results in an event sent to the parent, which results in an event raised to the parent. A correlation identifier has to survive all of these hops to be effective.

b1conrad avatar Jul 05 '22 18:07 b1conrad

Note: just changed the three "event" links in the previous comment to permalinks.

b1conrad avatar Jul 05 '22 19:07 b1conrad

This issue impacts another repo.

b1conrad avatar Jul 05 '22 20:07 b1conrad

So far, a very small change has satisfied one of that kind of path, in this commit of KRL-experiments.

b1conrad avatar Jul 05 '22 22:07 b1conrad