From: Mathieu Desnoyers Date: Tue, 3 Dec 2019 09:08:36 +0000 (-0500) Subject: Fix: relayd: per-pid live: no new metadata vs close X-Git-Tag: v2.12.0-rc1~165 X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=commitdiff_plain;h=94f73d0839c106a783f3c805aa74a2dbfb6bd5f5;hp=94f73d0839c106a783f3c805aa74a2dbfb6bd5f5 Fix: relayd: per-pid live: no new metadata vs close When using lttng-live on a per-pid UST trace, the metadata stream is closed after an application exits. The live viewer observes that the stream has no more data when getting the metadata returns 0 bytes. Internally in the relay daemon, it is assumed that a metadata stream can be put (and thus removed) as soon as all the metadata has been sent to the viewer, but this is not quite right. The viewer actually needs to observe a 0-byte reply after receiving all the metadata in order to gracefully perceive the metadata stream hang up. Therefore, add a no_new_metadata_notified flag to the metadata stream to track whether that 0-byte message has been sent to the viewer since the last metadata content was sent, and postpone the reclamation of the metadata stream until it is closed _and_ that 0-byte reply was sent to the live viewer. Signed-off-by: Mathieu Desnoyers Change-Id: I0a05332284299d62b832046e4f9d22b6029c3a3e Signed-off-by: Jérémie Galarneau ---