clockworklabs / clockworklabs/SpacetimeDB
Module crash should disconnect all clients
@gefjon is already working on this.
Since Apr 17, 2025.
- Dominant language
- Rust
- Stars
- 25.2k
- Forks
- 1.1k
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 46
Description
A module can crash for a number of reasons, including:
- persistence becomes fatally unwritable
- the current replica is demoted as the leader
- some unknown / unhandled panic
Desired behavior
When a module crashes, all currently connected clients should be disconnected (or, reset in some other way).
Observed behavior
All crash scenarios described above manifest in a panic that is intercepted by the ModuleHost executing a reducer call. The module is removed from the HostController and the unwinding is resumed.
This disconnects the caller, but not other clients connected to the same replica.
When those other clients attempt to call a reducer, a NoSuchModule error will be propagated to the client, but the client connection is not terminated (cf. subscribe.rs#L369). Note that module hot-swapping should never manifest in a NoSuchModule error at this point.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.