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)
committerJonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Wed, 10 Apr 2019 23:36:37 +0000 (19:36 -0400)
commitb53f5a46ad922a20148a3f683aa8fba728ec2a3e
tree5b6c1b4ad4e4863ca5ffd21a8d44ab1c7e95f37c
parentf5a36babeecda62a4ee87537febe06d53c8cd442
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.027303 seconds and 5 git commands to generate.