Fix: rotation: hang on destroy when using scheduled rotation based on timer
authorJonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Mon, 14 Feb 2022 16:23:28 +0000 (11:23 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 3 Mar 2022 16:49:41 +0000 (11:49 -0500)
commit9e540e10f0e6a67374cce8811b9bea6d9d504f65
treec5a28f9dedf27005dea5f87fd560d14df28586de
parent042ab0fa037f8117babd15939289199c5fc9e1be
Fix: rotation: hang on destroy when using scheduled rotation based on timer

Observed issue
==============

The following scenario results in a hang for `lttng destroy`:

lttng create test
lttng enable-event -u -a
lttng enable-rotation --timer 100000
lttng start
lttng stop
lttng start
lttng destroy

Cause
=====

There is an imbalance in how many times we start the rotation timer.

The rotation timer is only removed on `lttng destroy` or when disabling
a time-based-rotation. On the other hand, the timer is "started"
on `lttng start` and when enabling a time based rotation.

The imbalance emerging from a start/stop/start sequence would prevent the
teardown of the session object since each time the timer is started a
reference to the session is held.

Solution
========

Do not start the rotation schedule timer if it was already launched.

Known drawbacks
=========

None.

Change-Id: Ic5b8938166358fe7629187bebdf02a09e90846c0
Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng-sessiond/cmd.c
This page took 0.024948 seconds and 4 git commands to generate.