relayd: set has rotated only for explicit rotations
[lttng-tools.git] / src / bin / lttng-relayd / main.c
index 749feb6f6f319a95c86d62a68af0b5f693a7c4d3..5e99befa7c5c775ef888a4166366abf44a9a3114 100644 (file)
@@ -2372,7 +2372,6 @@ static int relay_rotate_session_streams(
                } else {
                        chunk_id_str = chunk_id_buf;
                }
-               session->has_rotated = true;
        }
 
        DBG("Rotate %" PRIu32 " streams of session \"%s\" to chunk \"%s\"",
@@ -2803,6 +2802,10 @@ static int relay_close_trace_chunk(const struct lttcomm_relayd_hdr *recv_hdr,
                        goto end_unlock_session;
                }
        }
+       if (close_command.is_set &&
+                       close_command.value == LTTNG_TRACE_CHUNK_COMMAND_TYPE_MOVE_TO_COMPLETED) {
+               session->has_rotated = true;
+       }
        DBG("Reply chunk path on close: %s", closed_trace_chunk_path);
        path_length = strlen(closed_trace_chunk_path) + 1;
        if (path_length > UINT32_MAX) {
This page took 0.023007 seconds and 4 git commands to generate.