feat(message)!: mark the wire-protocol enums #[non_exhaustive] - #3151
Merged
Conversation
`DaemonRequest`, `DaemonReply`, `InterDaemonEvent`, `CoordinatorRequest` and `DaemonEvent` are the bincode-serialized wire protocol, and they are public on the published `dora-message` crate. Without `#[non_exhaustive]` a downstream crate can match them exhaustively, so *every* future variant addition is a semver-major change. Adding the attribute is itself breaking, so it has to land before 1.0.0 or the protocol is frozen for the whole 1.x line. `NodeEvent` in this same module already carries it; this brings the other five in line. The in-tree fallbacks are deliberately per-site rather than uniform: - coordinator `CoordinatorRequest` / `DaemonEvent`: warn and continue. A newer daemon must not be able to tear down its connection by sending a message this coordinator predates. - daemon `DaemonRequest`: reply with an explicit error, so a newer node fails loudly instead of hanging on a reply that never arrives. - daemon / replay-node `InterDaemonEvent`: skip. The replay node counts the event as skipped so the existing "decoded none of N" guard still reports it. - CLI observability (`record`, `topic echo|hz|info`): skip — these are read-only views and should not break on an unknown event. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Contributor
|
😎 Merged successfully - details. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
DaemonRequest,DaemonReply,InterDaemonEvent,CoordinatorRequestandDaemonEventare the bincode-serialized wire protocol, and they are public on the publisheddora-messagecrate. Without#[non_exhaustive]a downstream crate can match them exhaustively, so every future variant addition is a semver-major change.Adding the attribute is itself breaking, so it has to land before 1.0.0 — otherwise the wire protocol is frozen for the whole 1.x line and any new variant forces a 2.0.0.
NodeEventin this same module already carries it; this brings the other five in line.Blocks #3121 (the 1.0.0 version bump).
In-tree fallbacks
The catch-all arms are deliberately per-site rather than uniform, because the right behaviour differs by role:
CoordinatorRequest,DaemonEventDaemonRequestInterDaemonEventrecord,topic echo|hz|infoValidation
cargo check --all(Python crates excluded) — cleancargo fmt --all -- --check— cleancargo clippy --all -- -D warnings(Python crates excluded) — cleancargo test -p dora-message -p dora-daemon -p dora-coordinator -p dora-node-api— 690 passed, 0 failedFollow-up worth considering
dora-memory-poolis also published, and its five public structs (MemoryPoolId,MemoryPoolMetadata,MemoryPoolEntry,CleanupSummary,MemoryPoolManager) are exhaustively constructible today — so adding a field to any of them after 1.0.0 is likewise semver-major. Same decision, different crate; worth settling before the bump rather than discovering it later.