Summary
When any ComputeNode panics inside on_bar() or on_calculate(), the panic propagates through Pipeline::process_node() and crashes the entire pipeline. A single misbehaving strategy node should not bring down the whole system.
Root Cause
src/crates/taiji/taiji-engine/src/pipeline/mod.rs — process_node() calls node.on_bar() and node.on_calculate() directly without panic isolation:
// Before fix:
node.on_bar(&bar, &mut store)?;
node.on_calculate(&mut store)?;
Any panic in these trait methods unwinds through the pipeline, killing all other nodes.
Evidence
- Reproducible: inject a NaN into indicator calculation → entire pipeline terminates
- Production risk: one bad strategy node kills live trading
- No
catch_unwind or equivalent guard existed
Fix
Wrapped on_bar() and on_calculate() in std::panic::catch_unwind(AssertUnwindSafe(|| { ... })). Panics are logged via tracing::error and the pipeline continues processing remaining nodes. Added use std::panic::{self, AssertUnwindSafe}.
Fixed in
Summary
When any
ComputeNodepanics insideon_bar()oron_calculate(), the panic propagates throughPipeline::process_node()and crashes the entire pipeline. A single misbehaving strategy node should not bring down the whole system.Root Cause
src/crates/taiji/taiji-engine/src/pipeline/mod.rs—process_node()callsnode.on_bar()andnode.on_calculate()directly without panic isolation:Any panic in these trait methods unwinds through the pipeline, killing all other nodes.
Evidence
catch_unwindor equivalent guard existedFix
Wrapped
on_bar()andon_calculate()instd::panic::catch_unwind(AssertUnwindSafe(|| { ... })). Panics are logged viatracing::errorand the pipeline continues processing remaining nodes. Addeduse std::panic::{self, AssertUnwindSafe}.Fixed in
src/crates/taiji/taiji-engine/src/pipeline/mod.rs