Project

General

Profile

Actions

Feature #853

closed

Live session is listed by relayd after the session has been destroyed

Added by Marc-Andre Laperle over 9 years ago. Updated over 7 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Julien Desfossez
Target version:
Start date:
10/30/2014
Due date:
% Done:

100%

Estimated time:

Description

I have a viewer (not babeltrace) connected to relayd using the live protocol and attached to a live session. The session is started then destroyed. Then I list the sessions again using the same viewer (LTTNG_VIEWER_LIST_SESSIONS) and it returns the destroyed session. If I try to attach to it, it returns a status LTTNG_VIEWER_ATTACH_ALREADY. I think this session should not be listed or there should be a status that indicates that the session doesn't exist anymore.


Files

relayd-log.txt (475 KB) relayd-log.txt Marc-Andre Laperle, 10/30/2014 05:15 PM
0001-Test-implement-a-command-to-detach-a-viewer-session.patch (4.01 KB) 0001-Test-implement-a-command-to-detach-a-viewer-session.patch Julien Desfossez, 11/18/2014 11:08 AM
0002-test-live-detach.patch (2.38 KB) 0002-test-live-detach.patch Julien Desfossez, 11/18/2014 11:08 AM
Actions #1

Updated by Marc-Andre Laperle over 9 years ago

If forgot to mention that I am using lttng-tools 2.5.1

You will find attached the verbose logging of relayd.

Actions #2

Updated by Christian Babeux over 9 years ago

  • Assignee set to Julien Desfossez
Actions #3

Updated by Julien Desfossez over 9 years ago

I have also already seen this behavior sometimes when playing with instable viewers, but I can't find a reliable way to reproduce it.
I tried killing babeltrace at various stages of the process but still no luck.

Do you have a reliable way to reproduce the problem that I could try ?

In the mean time, I'm investigating the various teardown paths.

Actions #4

Updated by Julien Desfossez over 9 years ago

  • Status changed from New to Confirmed
Actions #5

Updated by Julien Desfossez over 9 years ago

  • Status changed from Confirmed to Feedback

If you know at least at which stage the viewer is (getting indexes, metadata, streams, data, etc), that would help.

Because from what I see in the log, the viewer is still there: no error or disconnect. Are you sure this log contains the problem ?

Actions #6

Updated by Marc-Andre Laperle over 9 years ago

Julien Desfossez wrote:

I have also already seen this behavior sometimes when playing with instable viewers, but I can't find a reliable way to reproduce it.
I tried killing babeltrace at various stages of the process but still no luck.

I'm not sure you could reproduce this with babeltrace since it doesn't stay connected to relayd when the lttng session is destroyed.

Do you have a reliable way to reproduce the problem that I could try ?

Maybe I can try to modify live_test.c to demonstrate the problem. Of if you have the Eclipse setup, I can update my code a bit to make it shareable.

If you know at least at which stage the viewer is (getting indexes, metadata, streams, data, etc), that would help.

I'm not sure which state that would be... I guess "listing sessions"? Sorry, that I'm not very clear. It's the same viewer session all along. The first lttng session that was destroyed is still listed on a subsequent LTTNG_VIEWER_LIST_SESSIONS.

So basically:
1. create a live session (lttng create --live, etc)
2. Connect to relayd with a viewer, list the sessions, attach to the session...
3. Destroy the lttng session
4. Without the viewer disconnecting (so using the same viewer session), list the sessions again: the destroyed session is still listed, that would help.

Because from what I see in the log, the viewer is still there: no error or disconnect. Are you sure this log contains the problem ?

Yes the viewer should still be there, it's the same viewer session all along. The problem is that it's listing the destroyed lttng session again. I don't think there's much to see in the log about that unfortunately :(

Updated by Julien Desfossez over 9 years ago

Thanks for the clarification.
This is actually the normal behavior: the session is kept alive on the relay's viewer side until there is no viewer attached to it.
As soon as the viewer exits, the session is destroyed on the relay.

For Babeltrace, it makes sense to close the connection and exit when the session has been read entirely, but I understand that for TraceCompass, it would make more sense to keep the same network connection alive to attach to other sessions especially since we already allow a viewer to attach to multiple sessions at the same time.

Attached to this message is a patch to implement a detach command and a quick test. The viewer can call it when it is attached to a session and it will release it from the relayd.
Can you test it and tell me if that would be an appropriate solution for your use-case ?

Since this is a feature, it won't get in before the 2.7 merge window, but that shouldn't be too far.

Actions #8

Updated by Marc-Andre Laperle over 9 years ago

Thanks Julien, that sounds great. I hadn't planned to work on live in the next few days but I'll try to squeeze this in and get back to you quickly.

Actions #9

Updated by Marc-Andre Laperle over 9 years ago

Julien Desfossez wrote:

Attached to this message is a patch to implement a detach command and a quick test. The viewer can call it when it is attached to a session and it will release it from the relayd.
Can you test it and tell me if that would be an appropriate solution for your use-case ?

Hi Julien. I just tried the patch. This is very helpful! I can successfuly detach and attach again using the same view session, etc. So from my perspective, it is a good solution. Thanks again!

Actions #10

Updated by Julien Desfossez over 9 years ago

  • Tracker changed from Bug to Feature
  • Status changed from Feedback to Confirmed

Great !
So I'm moving this bug to a feature request and will send the patches as soon as we enter the 2.7 development cycle.

Thanks,

Julien

Actions #12

Updated by Julien Desfossez over 8 years ago

Oups, I had completely forgotten about this one.
Is it too late for this cycle (since we are in RC) ?
If it's not, I can submit the v2 this week.

Julien

Actions #13

Updated by Jérémie Galarneau over 8 years ago

It's not too late!

Actions #14

Updated by Jérémie Galarneau over 8 years ago

  • Target version set to 2.8
Actions #15

Updated by Marc-Andre Laperle over 8 years ago

I just want to let you know that it would still be a nice feature ;)

Actions #16

Updated by Jérémie Galarneau over 8 years ago

There were a lot of fixes to the relayd during the 2.7 RC cycle so we'll have to rework the patches for 2.8.

Actions #17

Updated by Julien Desfossez about 8 years ago

  • Status changed from Confirmed to Resolved
  • % Done changed from 0 to 100

Applied in changeset tools|commit:d62023be5fccac24ad404aff2915c1888c22755c.

Actions #18

Updated by Marc-Andre Laperle over 7 years ago

I can confirm that this works in LTTng Tools 2.8. With a viewer attached to a session, I can issue a VIEWER_DETACH_SESSION command, then VIEWER_LIST_SESSIONS does not contain the old session anymore. Thanks for this!

Actions

Also available in: Atom PDF