action executor: use an execution context to validate enqueued action before execution
authorJonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Tue, 13 Apr 2021 18:49:52 +0000 (14:49 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Sun, 18 Apr 2021 23:28:57 +0000 (19:28 -0400)
commit72365501d3148ca977a09bad8de0ec51b427bdd8
tree4408382743c09d694379b84e927598884f348a24
parent5c5373c3cbfebddb0068fe13600766bb381048da
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
src/bin/lttng-sessiond/action-executor.c
src/bin/lttng-sessiond/action-executor.h
src/bin/lttng-sessiond/notification-thread-events.c
This page took 0.025362 seconds and 4 git commands to generate.