You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Both packages/zaino-serve/src/server/jsonrpc.rs:86-95 and …/grpc.rs:49-58 build an explicit polling future to integrate with their underlying server's shutdown plumbing (jsonrpsee's stop race, tonic's serve_with_shutdown):
This block exists only because NamedAtomicStatus lacks a wake primitive. Observed shutdown latency from close() to signal completion: 0–100 ms (~50 ms typical).
let token = self.cancel_token.clone();let shutdown_signal = asyncmove{ token.cancelled().await};
close() calls self.cancel_token.cancel() AND still stores StatusType::Closing (the status flag remains the externally observable state indicator and gates status() reads).
Drop continues to abort() as a backstop for the "dropped without close" path.
Acceptance criteria
The shutdown_check_interval polling closure is gone from both jsonrpc.rs and grpc.rs.
New unit test asserts the shutdown-signal future completes within ~20 ms after close(). The test fails against the current polling pattern and passes after migration.
Parent: #1051
Today
Both
packages/zaino-serve/src/server/jsonrpc.rs:86-95and…/grpc.rs:49-58build an explicit polling future to integrate with their underlying server's shutdown plumbing (jsonrpsee'sstoprace, tonic'sserve_with_shutdown):This block exists only because
NamedAtomicStatuslacks a wake primitive. Observed shutdown latency fromclose()to signal completion: 0–100 ms (~50 ms typical).Proposed change
cancel_token: CancellationTokento bothJsonRpcServerandTonicServer(zaino-servealready getstokio-utiltransitively via the new dep added on DRY: extract shared DbCore lifecycle scaffolding from DbV0/DbV1 (~70 LOC) #1049's branch — verify).close()callsself.cancel_token.cancel()AND still storesStatusType::Closing(the status flag remains the externally observable state indicator and gatesstatus()reads).Dropcontinues toabort()as a backstop for the "dropped without close" path.Acceptance criteria
shutdown_check_intervalpolling closure is gone from bothjsonrpc.rsandgrpc.rs.close(). The test fails against the current polling pattern and passes after migration.Out of scope
CancellationToken; child-token wiring follows when zainod owns the root.