Fix: don't fail on push metadata if no channel
[lttng-tools.git] / src / bin / lttng-sessiond / ust-app.c
index 41a321f0a3a8dc5a10d1c7d15eca79bca621241c..72a3223c1fa53baa0bf8f413e9e9e99d7e6d335d 100644 (file)
@@ -481,6 +481,20 @@ push_data:
        ret = consumer_push_metadata(socket, registry->metadata_key,
                        metadata_str, len, offset);
        if (ret < 0) {
+               /*
+                * There is an acceptable race here between the registry metadata key
+                * assignment and the creation on the consumer. The session daemon can
+                * concurrently push metadata for this registry while being created on
+                * the consumer since the metadata key of the registry is assigned
+                * *before* it is setup to avoid the consumer to ask for metadata that
+                * could possibly be not found in the session daemon.
+                *
+                * The metadata will get pushed either by the session being stopped or
+                * the consumer requesting metadata if that race is triggered.
+                */
+               if (ret == -LTTCOMM_CONSUMERD_CHANNEL_FAIL) {
+                       ret = 0;
+               }
                ret_val = ret;
                goto error_push;
        }
This page took 0.02376 seconds and 4 git commands to generate.