X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Fbin%2Flttng-sessiond%2Fcmd.c;h=6df18935e0d1caadd24094aaf0ec03cfba06347c;hb=3a89d11a0ad0ca327e2df99eaf13d3a0c63e3af3;hp=4b8d82efe255d398d9e5eba605be42d96cec5421;hpb=6b453b5e07e90591c955ae14c60c13b7c1ed28a0;p=lttng-tools.git diff --git a/src/bin/lttng-sessiond/cmd.c b/src/bin/lttng-sessiond/cmd.c index 4b8d82efe..6df18935e 100644 --- a/src/bin/lttng-sessiond/cmd.c +++ b/src/bin/lttng-sessiond/cmd.c @@ -458,6 +458,7 @@ static int add_uri_to_consumer(struct consumer_output *consumer, * URI was the same in the consumer so we do not append the subdir * again so to not duplicate output dir. */ + ret = LTTNG_OK; goto error; } @@ -2531,6 +2532,21 @@ int cmd_data_pending(struct ltt_session *session) if (session->enabled) { ret = LTTNG_ERR_SESSION_STARTED; goto error; + } else { + /* + * If stopped, just make sure we've started before else the above call + * will always send that there is data pending. + * + * The consumer assumes that when the data pending command is received, + * the trace has been started before or else no output data is written + * by the streams which is a condition for data pending. So, this is + * *VERY* important that we don't ask the consumer before a start + * trace. + */ + if (!session->started) { + ret = 0; + goto error; + } } if (ksess && ksess->consumer) {