Fix: use a free running channel key between sessiond and kernel consumer
authorJulien Desfossez <jdesfossez@efficios.com>
Thu, 30 Nov 2017 20:31:27 +0000 (15:31 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 28 Feb 2018 03:32:34 +0000 (22:32 -0500)
commite1f3997aa650554880105d787a864653add7c070
treead5d0fadbf16262fd87732e1f8296913e6767695
parent8192bd8fb712659b9204549f29d9a54dc2c57a9e
Fix: use a free running channel key between sessiond and kernel consumer

We currently use the channel FD number opened by the session daemon to
reference a channel in the consumer. This can lead to races where the
session daemon destroys a channel and recreates one with the same FD
number before the consumer has time to cleanup everything on its side,
so all the commands in between that use that FD number has a key may end
up working on the wrong objects.

This fix introduces a free running counter as the channel key, so this
decouples the channel key in the consumer from the channel FD in the
session daemon. This fixes the race observed in stress tests.

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng-sessiond/cmd.c
src/bin/lttng-sessiond/kernel-consumer.c
src/bin/lttng-sessiond/kernel.c
src/bin/lttng-sessiond/trace-kernel.c
src/bin/lttng-sessiond/trace-kernel.h
This page took 0.027501 seconds and 5 git commands to generate.