Fix: create_channel_per_pid: remove channel on error
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 14 Nov 2018 22:49:21 +0000 (17:49 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 16 Nov 2018 22:45:05 +0000 (17:45 -0500)
commitcebb8722faefb09c6cc102aae237275e96603a23
tree961254d9bce3741ae32198834d54b59f3ed5123f
parent2ac146ae95a471eed1ed6dfda38e0be38daca82a
Fix: create_channel_per_pid: remove channel on error

The notification system of the session daemon tracks the lifetime
of per-pid buffers (in effect, channel keys) using two hooks:
  - the successful completion of create_channel_per_pid()
  - the deletion of the channel from an application's registry

Multiple error paths in create_channel_per_pid() can leave a channel
in an app's registry without notifying the notification system of its
existence.

When the channel is finally cleaned-up, the channel deletion hook will
inform the notification system that the channel should be deleted,
resulting in an error as that channel was previously unknown.

This fix ensures we remove the application's channel from its registry
on error (with the notify parameter set to 'false'), thus ensuring
that the notification system never tracks the incomplete channel.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng-sessiond/ust-app.c
This page took 0.027044 seconds and 4 git commands to generate.