Skip to content

Commit f34b396

Browse files
sanitygithub-actions[bot]iduartgomez
authored
fix: stabilize session actor fanout (#2062)
Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com> Co-authored-by: nacho.d.g <iduartgomez@users.noreply.github.com>
1 parent b474ef8 commit f34b396

File tree

4 files changed

+517
-72
lines changed

4 files changed

+517
-72
lines changed

crates/core/src/client_events/mod.rs

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1155,34 +1155,37 @@ async fn process_open_request(
11551155
tracing::debug!(
11561156
peer_id = %peer_id,
11571157
key = %key,
1158-
"Starting direct SUBSCRIBE operation (legacy mode)",
1158+
"Starting direct SUBSCRIBE operation",
11591159
);
11601160

1161-
// Legacy mode: direct operation without deduplication
1162-
let op_id =
1163-
crate::node::subscribe(op_manager.clone(), key, Some(client_id))
1164-
.await
1165-
.inspect_err(|err| {
1166-
tracing::error!("Subscribe error: {}", err);
1167-
})?;
1168-
1169-
tracing::debug!(
1170-
request_id = %request_id,
1171-
transaction_id = %op_id,
1172-
operation = "subscribe",
1173-
"Request-Transaction correlation"
1174-
);
1161+
// Generate transaction, register first, then run op
1162+
let tx = crate::message::Transaction::new::<
1163+
crate::operations::subscribe::SubscribeMsg,
1164+
>();
11751165

11761166
op_manager
11771167
.ch_outbound
1178-
.waiting_for_transaction_result(op_id, client_id, request_id)
1168+
.waiting_for_transaction_result(tx, client_id, request_id)
11791169
.await
11801170
.inspect_err(|err| {
11811171
tracing::error!(
11821172
"Error waiting for transaction result: {}",
11831173
err
11841174
);
11851175
})?;
1176+
1177+
crate::node::subscribe_with_id(op_manager.clone(), key, None, Some(tx))
1178+
.await
1179+
.inspect_err(|err| {
1180+
tracing::error!("Subscribe error: {}", err);
1181+
})?;
1182+
1183+
tracing::debug!(
1184+
request_id = %request_id,
1185+
transaction_id = %tx,
1186+
operation = "subscribe",
1187+
"Request-Transaction correlation"
1188+
);
11861189
}
11871190
}
11881191
_ => {

0 commit comments

Comments
 (0)