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>
Wed, 13 Nov 2019 19:41:28 +0000 (14:41 -0500)
commit52c91a6e27d2024f1b5d89fc25c9271449793661
treede6f0aebc0a0dbeea35b106f6573419bb91b4867
parentadfef72643e389586bc76582a0e88d806ae96c4c
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.025764 seconds and 4 git commands to generate.