[BUG] taiji-engine: Pipeline panic propagation — node panic crashes entire pipeline
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_unwindor 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
- PR: https://github.com/GCWing/BitFun/pull/1674
- File:
src/crates/taiji/taiji-engine/src/pipeline/mod.rs
已迁移至太极独立仓库。本 Issue 为太极项目专属 BUG,不属于 BitFun 通用范畴,故关闭。修复代码保留在 PR #1674 中供参考。