[lttng-dev] Race condition between lttng destroy and lttng load commands

Jérémie Galarneau jeremie.galarneau at efficios.com
Thu Jun 14 15:37:48 EDT 2018

Hi Douglas,

I was able to reproduce the problem on my end and pushed a patch.
Can you test with the latest master to confirm the problem is fixed?


On 11 June 2018 at 15:50, Douglas Graham <douglas.graham at ericsson.com> wrote:
> Regarding https://lists.lttng.org/pipermail/lttng-dev/2018-June/028074.html,
> it may not be obvious that the reason he is bringing that up is that we (Ericsson)
> need that functionality to implement the clear log functionality that we have
> mentioned to you before. To clear the logs, we currently do:
> $ lttng save <save_file>
> $ lttng stop
> $ lttng destroy
> $ lttng load <save_file>
> The lttng destroy is supposed to shut down the lttng session and clear all the
> existing logs.  Then the lttng load restores the session as it was before the
> destroy.  This works most of the time but it seems that there is a race.
> Lttng destroy isn't guaranteed to have finished shutting down and destroying
> the session by the time control returns to the shell.  We occasionally see the
> "lttng load" fail because it is trying to recreate a directory tree that is still
> in the process of being removed by "lttng destroy".
> The problem seems to be that the directory tree is removed with a call to
> call_rcu(&regp->node.head, rcu_free_buffer_reg_uid). The function
> rcu_free_buffer_reg_uid() is run asynchronously and is not guaranteed to have
> finished by the time call_rcu() returns.  I think this should probably be
> considered a deficiency in the implementation of "lttng destroy".  Is this
> something that can be easily fixed or should we be looking for a workaround?
> Thanks,
> Doug
> _______________________________________________
> lttng-dev mailing list
> lttng-dev at lists.lttng.org
> https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

Jérémie Galarneau
EfficiOS Inc.

More information about the lttng-dev mailing list