summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
317eade)
The list sessions command currently returns sessions that do not
have a current trace chunk. This can be caused by the session
either being destroyed or being so young that it hasn't had a
trace chunk created against it yet.
In both cases, such sessions would not be attacheable in their
current condition. This fix omits them from from the listing
to reduce the number of failures at the "attach session" and
"attach stream" step.
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ pthread_mutex_lock(&session->lock);
if (session->connection_closed) {
/* Skip closed session */
if (session->connection_closed) {
/* Skip closed session */
+ goto next_session;
+ }
+ if (!session->current_trace_chunk) {
+ /*
+ * Skip un-attachable session. It is either
+ * being destroyed or has not had a trace
+ * chunk created against it yet.
+ */
+ goto next_session;
}
if (count >= buf_count) {
}
if (count >= buf_count) {
new_buf_count * sizeof(*send_session_buf));
if (!newbuf) {
ret = -1;
new_buf_count * sizeof(*send_session_buf));
if (!newbuf) {
ret = -1;
}
send_session_buf = newbuf;
buf_count = new_buf_count;
}
send_session_buf = newbuf;
buf_count = new_buf_count;
session->session_name,
sizeof(send_session->session_name))) {
ret = -1;
session->session_name,
sizeof(send_session->session_name))) {
ret = -1;
}
if (lttng_strncpy(send_session->hostname, session->hostname,
sizeof(send_session->hostname))) {
ret = -1;
}
if (lttng_strncpy(send_session->hostname, session->hostname,
sizeof(send_session->hostname))) {
ret = -1;
}
send_session->id = htobe64(session->id);
send_session->live_timer = htobe32(session->live_timer);
}
send_session->id = htobe64(session->id);
send_session->live_timer = htobe32(session->live_timer);
}
send_session->streams = htobe32(session->stream_count);
count++;
}
send_session->streams = htobe32(session->stream_count);
count++;
+ next_session:
+ pthread_mutex_unlock(&session->lock);
+ continue;
+ break_loop:
+ pthread_mutex_unlock(&session->lock);
+ break;
}
rcu_read_unlock();
if (ret < 0) {
}
rcu_read_unlock();
if (ret < 0) {