action executor: use an execution context to validate enqueued action before execution
Problem
======
Let's walk over the following scenario:
Trigger my_trigger:
condition: ust event a
action: start session S
At time T, session S exists.
At T + 1, the event A is hit.
At T + 2, the tracer event notification is received and the work item is
queued. Here session S have an id of 1.
At T + 3, the session S is destroyed and a new session S is created,
with a resulting id of 200.
At T +4, the work item is popped from the queue and begin execution and
will start session S with an id of 200 instead of the session S id 1
that was present at the queuing phase.
We effectively want to assign an execution context to an action at the
queuing phase and validate that the execution context is still valid
upon actual execution.
Solution
=====
Instead of iterating over the trigger's actions, we prepare an array of
work sub-item (action_work_subitem) that effectively is a flattened and
augmented array of the trigger's action. For now only the session id is
an action level execution context.
Each action handler is responsible of validating the execution context
before performing the action.
Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: I72fbe8d52d77d1d696fa7d99b662b77e9dad02d5
This page took 0.027261 seconds and 4 git commands to generate.