Skip to content
This repository was archived by the owner on Jun 19, 2026. It is now read-only.

Commit e2ebce0

Browse files
Rename shutdown errors to connection
1 parent 7eccd9b commit e2ebce0

21 files changed

Lines changed: 101 additions & 64 deletions

docs/content/spec/rpc.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ weight = 12
270270
> `Cancelled`
271271
> * **Connection interruption** — the connection ended before this call
272272
> received a terminal response. Current APIs may spell this as
273-
> `ConnectionClosed`, `SessionShutdown`, or `SendFailed` while migration is
273+
> `ConnectionClosed`, `ConnectionShutdown`, or `SendFailed` while migration is
274274
> in progress.
275275
> * **Indeterminate** — the runtime cannot safely determine whether the
276276
> request attempt reached a terminal outcome

rust/vox-core/src/driver.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2077,7 +2077,7 @@ impl DriverCaller {
20772077
let outcome = match &error {
20782078
VoxError::Cancelled => RpcOutcome::Cancelled,
20792079
VoxError::TimedOut => RpcOutcome::TimedOut,
2080-
VoxError::ConnectionClosed | VoxError::SessionShutdown => RpcOutcome::Closed,
2080+
VoxError::ConnectionClosed | VoxError::ConnectionShutdown => RpcOutcome::Closed,
20812081
VoxError::SendFailed => RpcOutcome::SendFailed,
20822082
VoxError::Indeterminate => RpcOutcome::Indeterminate,
20832083
VoxError::User(_) | VoxError::UnknownMethod | VoxError::InvalidPayload(_) => {
@@ -2594,7 +2594,7 @@ impl<H: Handler<DriverReplySink>> Driver<H> {
25942594
self.shared.pending_responses.lock().clear();
25952595
self.shared.request_scopes.lock().clear();
25962596
let close_reason =
2597-
(*self.closed_rx.borrow()).unwrap_or(ConnectionCloseReason::SessionShutdown);
2597+
(*self.closed_rx.borrow()).unwrap_or(ConnectionCloseReason::ConnectionShutdown);
25982598
self.shared.set_connection_closed(close_reason);
25992599

26002600
// Connection is gone: drop channel runtime state so any registered Rx

rust/vox-core/src/session/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1390,7 +1390,7 @@ impl Connection {
13901390
}
13911391

13921392
// Drop all connection slots so per-connection drivers exit immediately.
1393-
self.close_all_connections(ConnectionCloseReason::SessionShutdown);
1393+
self.close_all_connections(ConnectionCloseReason::ConnectionShutdown);
13941394
trace!("session recv loop exited");
13951395
}
13961396

@@ -2091,7 +2091,7 @@ impl Connection {
20912091
async fn handle_drop_control_request(&mut self, req: DropControlRequest) -> bool {
20922092
match req {
20932093
DropControlRequest::Shutdown => {
2094-
trace!("session shutdown requested");
2094+
trace!("connection shutdown requested");
20952095
false
20962096
}
20972097
DropControlRequest::Close(conn_id) => {

rust/vox-core/src/tests/driver_tests.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1425,9 +1425,9 @@ async fn in_flight_call_returns_cancelled_when_peer_closes() {
14251425
assert!(
14261426
matches!(
14271427
result,
1428-
Err(VoxError::ConnectionClosed) | Err(VoxError::SessionShutdown)
1428+
Err(VoxError::ConnectionClosed) | Err(VoxError::ConnectionShutdown)
14291429
),
1430-
"expected ConnectionClosed or SessionShutdown after peer close, got: {result:?}"
1430+
"expected ConnectionClosed or ConnectionShutdown after peer close, got: {result:?}"
14311431
);
14321432

14331433
for _ in 0..20 {
@@ -1544,7 +1544,7 @@ async fn outbound_max_concurrent_requests_waits_for_peer_limit() {
15441544
assert!(
15451545
matches!(
15461546
first_result,
1547-
Err(VoxError::ConnectionClosed) | Err(VoxError::SessionShutdown)
1547+
Err(VoxError::ConnectionClosed) | Err(VoxError::ConnectionShutdown)
15481548
),
15491549
"expected first call to fail with connection/session closure, got {first_result:?}"
15501550
);
@@ -1556,7 +1556,7 @@ async fn outbound_max_concurrent_requests_waits_for_peer_limit() {
15561556
assert!(
15571557
matches!(
15581558
second_result,
1559-
Err(VoxError::ConnectionClosed) | Err(VoxError::SessionShutdown)
1559+
Err(VoxError::ConnectionClosed) | Err(VoxError::ConnectionShutdown)
15601560
),
15611561
"expected queued second call to fail with connection/session closure, got {second_result:?}"
15621562
);
@@ -1719,9 +1719,9 @@ async fn keepalive_timeout_returns_cancelled_when_pongs_are_missing() {
17191719
assert!(
17201720
matches!(
17211721
result,
1722-
Err(VoxError::ConnectionClosed) | Err(VoxError::SessionShutdown)
1722+
Err(VoxError::ConnectionClosed) | Err(VoxError::ConnectionShutdown)
17231723
),
1724-
"expected ConnectionClosed or SessionShutdown after keepalive timeout, got: {result:?}"
1724+
"expected ConnectionClosed or ConnectionShutdown after keepalive timeout, got: {result:?}"
17251725
);
17261726
}
17271727

@@ -2129,7 +2129,7 @@ async fn virtual_connection_request_ids_use_connection_parity() {
21292129
assert!(
21302130
matches!(
21312131
result,
2132-
Err(VoxError::ConnectionClosed) | Err(VoxError::SessionShutdown)
2132+
Err(VoxError::ConnectionClosed) | Err(VoxError::ConnectionShutdown)
21332133
),
21342134
"expected virtual call to fail after close, got {result:?}"
21352135
);

rust/vox-macros-core/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1000,7 +1000,7 @@ fn generate_client_method(
10001000
#vox::VoxError::InvalidPayload(msg) => #vox::VoxError::<#err_ty>::InvalidPayload(msg),
10011001
#vox::VoxError::Cancelled => #vox::VoxError::<#err_ty>::Cancelled,
10021002
#vox::VoxError::ConnectionClosed => #vox::VoxError::<#err_ty>::ConnectionClosed,
1003-
#vox::VoxError::SessionShutdown => #vox::VoxError::<#err_ty>::SessionShutdown,
1003+
#vox::VoxError::ConnectionShutdown => #vox::VoxError::<#err_ty>::ConnectionShutdown,
10041004
#vox::VoxError::SendFailed => #vox::VoxError::<#err_ty>::SendFailed,
10051005
#vox::VoxError::TimedOut => #vox::VoxError::<#err_ty>::TimedOut,
10061006
#vox::VoxError::Indeterminate => #vox::VoxError::<#err_ty>::Indeterminate,
@@ -1058,7 +1058,7 @@ fn generate_client_method(
10581058
#vox::VoxError::InvalidPayload(msg) => #vox::VoxError::<#err_ty>::InvalidPayload(msg),
10591059
#vox::VoxError::Cancelled => #vox::VoxError::<#err_ty>::Cancelled,
10601060
#vox::VoxError::ConnectionClosed => #vox::VoxError::<#err_ty>::ConnectionClosed,
1061-
#vox::VoxError::SessionShutdown => #vox::VoxError::<#err_ty>::SessionShutdown,
1061+
#vox::VoxError::ConnectionShutdown => #vox::VoxError::<#err_ty>::ConnectionShutdown,
10621062
#vox::VoxError::SendFailed => #vox::VoxError::<#err_ty>::SendFailed,
10631063
#vox::VoxError::TimedOut => #vox::VoxError::<#err_ty>::TimedOut,
10641064
#vox::VoxError::Indeterminate => #vox::VoxError::<#err_ty>::Indeterminate,

rust/vox-macros-core/src/snapshots/vox_macros_core__tests__adder_infallible.snap

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,12 +232,15 @@ impl AdderClient {
232232
::vox::VoxError::ConnectionClosed => {
233233
::vox::VoxError::<::core::convert::Infallible>::ConnectionClosed
234234
}
235-
::vox::VoxError::SessionShutdown => {
236-
::vox::VoxError::<::core::convert::Infallible>::SessionShutdown
235+
::vox::VoxError::ConnectionShutdown => {
236+
::vox::VoxError::<::core::convert::Infallible>::ConnectionShutdown
237237
}
238238
::vox::VoxError::SendFailed => {
239239
::vox::VoxError::<::core::convert::Infallible>::SendFailed
240240
}
241+
::vox::VoxError::TimedOut => {
242+
::vox::VoxError::<::core::convert::Infallible>::TimedOut
243+
}
241244
::vox::VoxError::Indeterminate => {
242245
::vox::VoxError::<::core::convert::Infallible>::Indeterminate
243246
}

rust/vox-macros-core/src/snapshots/vox_macros_core__tests__borrowed_return_mixed_with_borrowed_args_and_channels_compiles_to_expected_shapes.snap

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -408,12 +408,15 @@ impl WordLabClient {
408408
::vox::VoxError::ConnectionClosed => {
409409
::vox::VoxError::<::core::convert::Infallible>::ConnectionClosed
410410
}
411-
::vox::VoxError::SessionShutdown => {
412-
::vox::VoxError::<::core::convert::Infallible>::SessionShutdown
411+
::vox::VoxError::ConnectionShutdown => {
412+
::vox::VoxError::<::core::convert::Infallible>::ConnectionShutdown
413413
}
414414
::vox::VoxError::SendFailed => {
415415
::vox::VoxError::<::core::convert::Infallible>::SendFailed
416416
}
417+
::vox::VoxError::TimedOut => {
418+
::vox::VoxError::<::core::convert::Infallible>::TimedOut
419+
}
417420
::vox::VoxError::Indeterminate => {
418421
::vox::VoxError::<::core::convert::Infallible>::Indeterminate
419422
}
@@ -481,12 +484,15 @@ impl WordLabClient {
481484
::vox::VoxError::ConnectionClosed => {
482485
::vox::VoxError::<::core::convert::Infallible>::ConnectionClosed
483486
}
484-
::vox::VoxError::SessionShutdown => {
485-
::vox::VoxError::<::core::convert::Infallible>::SessionShutdown
487+
::vox::VoxError::ConnectionShutdown => {
488+
::vox::VoxError::<::core::convert::Infallible>::ConnectionShutdown
486489
}
487490
::vox::VoxError::SendFailed => {
488491
::vox::VoxError::<::core::convert::Infallible>::SendFailed
489492
}
493+
::vox::VoxError::TimedOut => {
494+
::vox::VoxError::<::core::convert::Infallible>::TimedOut
495+
}
490496
::vox::VoxError::Indeterminate => {
491497
::vox::VoxError::<::core::convert::Infallible>::Indeterminate
492498
}
@@ -560,12 +566,15 @@ impl WordLabClient {
560566
::vox::VoxError::ConnectionClosed => {
561567
::vox::VoxError::<::core::convert::Infallible>::ConnectionClosed
562568
}
563-
::vox::VoxError::SessionShutdown => {
564-
::vox::VoxError::<::core::convert::Infallible>::SessionShutdown
569+
::vox::VoxError::ConnectionShutdown => {
570+
::vox::VoxError::<::core::convert::Infallible>::ConnectionShutdown
565571
}
566572
::vox::VoxError::SendFailed => {
567573
::vox::VoxError::<::core::convert::Infallible>::SendFailed
568574
}
575+
::vox::VoxError::TimedOut => {
576+
::vox::VoxError::<::core::convert::Infallible>::TimedOut
577+
}
569578
::vox::VoxError::Indeterminate => {
570579
::vox::VoxError::<::core::convert::Infallible>::Indeterminate
571580
}

rust/vox-macros-core/src/snapshots/vox_macros_core__tests__borrowed_vox_cow_return.snap

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,12 +238,15 @@ impl TextSvcClient {
238238
::vox::VoxError::ConnectionClosed => {
239239
::vox::VoxError::<::core::convert::Infallible>::ConnectionClosed
240240
}
241-
::vox::VoxError::SessionShutdown => {
242-
::vox::VoxError::<::core::convert::Infallible>::SessionShutdown
241+
::vox::VoxError::ConnectionShutdown => {
242+
::vox::VoxError::<::core::convert::Infallible>::ConnectionShutdown
243243
}
244244
::vox::VoxError::SendFailed => {
245245
::vox::VoxError::<::core::convert::Infallible>::SendFailed
246246
}
247+
::vox::VoxError::TimedOut => {
248+
::vox::VoxError::<::core::convert::Infallible>::TimedOut
249+
}
247250
::vox::VoxError::Indeterminate => {
248251
::vox::VoxError::<::core::convert::Infallible>::Indeterminate
249252
}

rust/vox-macros-core/src/snapshots/vox_macros_core__tests__borrowed_vox_return.snap

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,12 +236,15 @@ impl HasherClient {
236236
::vox::VoxError::ConnectionClosed => {
237237
::vox::VoxError::<::core::convert::Infallible>::ConnectionClosed
238238
}
239-
::vox::VoxError::SessionShutdown => {
240-
::vox::VoxError::<::core::convert::Infallible>::SessionShutdown
239+
::vox::VoxError::ConnectionShutdown => {
240+
::vox::VoxError::<::core::convert::Infallible>::ConnectionShutdown
241241
}
242242
::vox::VoxError::SendFailed => {
243243
::vox::VoxError::<::core::convert::Infallible>::SendFailed
244244
}
245+
::vox::VoxError::TimedOut => {
246+
::vox::VoxError::<::core::convert::Infallible>::TimedOut
247+
}
245248
::vox::VoxError::Indeterminate => {
246249
::vox::VoxError::<::core::convert::Infallible>::Indeterminate
247250
}

rust/vox-macros-core/src/snapshots/vox_macros_core__tests__borrowed_vox_return_call_style.snap

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,12 +236,15 @@ impl HasherClient {
236236
::vox::VoxError::ConnectionClosed => {
237237
::vox::VoxError::<::core::convert::Infallible>::ConnectionClosed
238238
}
239-
::vox::VoxError::SessionShutdown => {
240-
::vox::VoxError::<::core::convert::Infallible>::SessionShutdown
239+
::vox::VoxError::ConnectionShutdown => {
240+
::vox::VoxError::<::core::convert::Infallible>::ConnectionShutdown
241241
}
242242
::vox::VoxError::SendFailed => {
243243
::vox::VoxError::<::core::convert::Infallible>::SendFailed
244244
}
245+
::vox::VoxError::TimedOut => {
246+
::vox::VoxError::<::core::convert::Infallible>::TimedOut
247+
}
245248
::vox::VoxError::Indeterminate => {
246249
::vox::VoxError::<::core::convert::Infallible>::Indeterminate
247250
}

0 commit comments

Comments
 (0)