Skip to content

Commit d3aa38e

Browse files
committed
fix: complete parent PUT when child subscribe finishes
- Treat LocalSubscribeComplete for sub-ops as completion to unblock parent PUTs - Add logging when root ops await sub-ops for clarity during debugging
1 parent 89faadd commit d3aa38e

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

crates/core/src/node/network_bridge/p2p_protoc.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -976,6 +976,13 @@ impl P2pConnManager {
976976
} => {
977977
tracing::debug!(%tx, %key, "local subscribe complete");
978978

979+
// If this is a child operation, complete it and let the parent flow handle result delivery.
980+
if op_manager.is_sub_operation(tx) {
981+
tracing::info!(%tx, %key, "completing child subscribe operation");
982+
op_manager.completed(tx);
983+
continue;
984+
}
985+
979986
if !op_manager.is_sub_operation(tx) {
980987
let response = Ok(HostResponse::ContractResponse(
981988
ContractResponse::SubscribeResponse { key, subscribed },

crates/core/src/operations/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,11 @@ where
126126
"root operation awaiting child completion"
127127
);
128128

129+
// Track the root op so child completions can finish it later.
129130
op_manager
130131
.root_ops_awaiting_sub_ops()
131132
.insert(tx_id, final_state);
133+
tracing::info!(%tx_id, "root operation registered as awaiting sub-ops");
132134

133135
return Ok(None);
134136
}

0 commit comments

Comments
 (0)