Summary
Only connect() and status() on EtcdCoordinator (in crates/gossip-coordination-etcd/src/backend/coordinator.rs) currently enforce the runtime precondition guard:
assert!(
tokio::runtime::Handle::try_current().is_err(),
"connect() must not be called from within an active Tokio runtime"
);
All other public sync entry points that reach self.runtime.block_on() are missing this guard. Callers invoking these methods from an async context will deadlock inside Tokio instead of receiving the explicit contract error documented on the type.
Affected methods
etcd_get
etcd_txn
etcd_lease_grant
etcd_lease_keep_alive_once
etcd_lease_revoke
list_active_runs_into
gc_stale_initializing_runs_into
- Sync trait implementations backing
create_run, renew, and related operations
Proposed fix
Add the same assertion at the top of each affected method, before any use of self.runtime or block_on, mirroring the existing connect()/status() semantics.
Background
Deferred from PR #148 (module split refactor) to keep that PR focused. See the review comment: #148 (comment)
Requested by: @ahrav
Summary
Only
connect()andstatus()onEtcdCoordinator(incrates/gossip-coordination-etcd/src/backend/coordinator.rs) currently enforce the runtime precondition guard:All other public sync entry points that reach
self.runtime.block_on()are missing this guard. Callers invoking these methods from an async context will deadlock inside Tokio instead of receiving the explicit contract error documented on the type.Affected methods
etcd_getetcd_txnetcd_lease_grantetcd_lease_keep_alive_onceetcd_lease_revokelist_active_runs_intogc_stale_initializing_runs_intocreate_run,renew, and related operationsProposed fix
Add the same assertion at the top of each affected method, before any use of
self.runtimeorblock_on, mirroring the existingconnect()/status()semantics.Background
Deferred from PR #148 (module split refactor) to keep that PR focused. See the review comment: #148 (comment)
Requested by: @ahrav