chore: phase 1 cleanup — proper shutdown, flow resource cleanup, test fix
- node_runner: track all readers/writers in flow_resources vector, release them via mxlReleaseFlowWriter/mxlReleaseFlowReader before destroying the MXL instance (fixes 'leaked flow writer' warning) - node_runner: remove_writer/remove_reader commands now also release the MXL flow resources, not just reset the node's optional<> - engine: call process_manager.stop_all(graph) on shutdown to kill child node processes (prevents orphaned passthrough processes) - graph: add get_node_mut() for process_manager to update node state - process_manager: implement stop_all(Graph&) that SIGTERMs all running node processes - passthrough: reduce logging to first-grain and realign-once only - tests: update flow format assertion to match NMOS (urn:x-nmos:format:video instead of video/v210)
This commit is contained in:
@@ -64,12 +64,12 @@ void PassthroughNode::process() {
|
||||
auto status = mxlFlowReaderGetGrain(*reader_, read_index_, 5000000ULL, &grain_info, &payload);
|
||||
if (status != MXL_STATUS_OK) {
|
||||
if (status == MXL_ERR_OUT_OF_RANGE_TOO_LATE || status == MXL_ERR_OUT_OF_RANGE_TOO_EARLY) {
|
||||
auto old_index = read_index_;
|
||||
auto now = mxlGetTime();
|
||||
auto current_index = mxlTimestampToIndex(&grain_rate_, now);
|
||||
read_index_ = current_index - READ_DELAY_GRAINS;
|
||||
spdlog::warn("Passthrough: index {} out of range ({}), realigned to {}",
|
||||
old_index, static_cast<int>(status), read_index_);
|
||||
if (grains_processed_ == 0) {
|
||||
spdlog::warn("Passthrough: realigned to index {}", read_index_);
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -94,8 +94,8 @@ void PassthroughNode::process() {
|
||||
read_index_++;
|
||||
grains_processed_++;
|
||||
|
||||
if (grains_processed_ <= 5 || grains_processed_ % 50 == 0) {
|
||||
spdlog::info("Passthrough: grain #{}, index={}, size={}", grains_processed_, grain_info.index, grain_info.grainSize);
|
||||
if (grains_processed_ == 1) {
|
||||
spdlog::info("Passthrough: first grain processed, index={}", grain_info.index);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user