Fix: relayd: session trace chunk is copied too late
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 12 Nov 2019 04:38:25 +0000 (23:38 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 12 Nov 2019 22:01:02 +0000 (17:01 -0500)
commitdbd6665b396de85a4d6b311c8942f82ea9813891
tree702a9a49478849049e1d9748f9089cf366ba8cd4
parenteb60c7af29eaaefeb68516339df2c7f86136ce23
Fix: relayd: session trace chunk is copied too late

In per-pid buffering mode, a viewer can attach to a session while it
is active and find it has been closed by the time it requests new
streams. The viewer session's trace chunk is created as a side-effect
of the "get_new_streams" command and can find that the relay_session's
trace chunk has now been closed, causing the creation of the viewer
session trace chunk to fail.

This results in an unexpected error being reported to the live client.
This fix moves the creation of the viewer session's trace chunk to the
"attach" command. If the creation fails, the session is reported as
being "unknown".

Reported-by: Francis Deslauriers <francis.deslauriers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Tested-by: Francis Deslauriers <francis.deslauriers@efficios.com>
src/bin/lttng-relayd/live.c
src/bin/lttng-relayd/viewer-session.c
src/bin/lttng-relayd/viewer-session.h
This page took 0.025287 seconds and 4 git commands to generate.