Problem
The dynamic engine actor (crates/engine/src/dynamic_actor.rs) calls registry.create_node() (the synchronous version) inside spawn_blocking. The registry also has create_node_async (crates/core/src/registry.rs:332) which supports the ResourceManager for shared resource caching (e.g., ML models shared across multiple node instances).
Impact
Nodes created via the dynamic engine cannot benefit from shared resource management. Each node instance loads its own copy of resources (e.g., ONNX models), increasing memory usage.
Suggested fix
Switch from create_node inside spawn_blocking to create_node_async inside a regular tokio::spawn. Since create_node_async is async, it cannot run inside spawn_blocking. The FFI blocking concern would need to be handled differently — possibly by having create_node_async internally use spawn_blocking for the synchronous factory call while keeping the resource acquisition async.
Context
Pre-existing limitation identified during review of PR #286 (async AddNode). The old synchronous code also used create_node, not create_node_async.
Problem
The dynamic engine actor (
crates/engine/src/dynamic_actor.rs) callsregistry.create_node()(the synchronous version) insidespawn_blocking. The registry also hascreate_node_async(crates/core/src/registry.rs:332) which supports theResourceManagerfor shared resource caching (e.g., ML models shared across multiple node instances).Impact
Nodes created via the dynamic engine cannot benefit from shared resource management. Each node instance loads its own copy of resources (e.g., ONNX models), increasing memory usage.
Suggested fix
Switch from
create_nodeinsidespawn_blockingtocreate_node_asyncinside a regulartokio::spawn. Sincecreate_node_asyncis async, it cannot run insidespawn_blocking. The FFI blocking concern would need to be handled differently — possibly by havingcreate_node_asyncinternally usespawn_blockingfor the synchronous factory call while keeping the resource acquisition async.Context
Pre-existing limitation identified during review of PR #286 (async AddNode). The old synchronous code also used
create_node, notcreate_node_async.