Repository navigation
fix(xenstore): encode UNWATCH path before token - #480
Open
agocharbhatia wants to merge 1 commit into
Open
agocharbhatia wants to merge 1 commit into
agocharbhatia wants to merge 1 commit into
Conversation
agocharbhatia
force-pushed
the
fix/unwatch-payload-order
branch
from
November 2, 2026 00:56
13f7c98 to
990aebc
Compare
This branch has not been deployed
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.
Problem
The Xenstore protocol identifies a watch by
path, thentoken, with each field NUL terminated. WATCH registration already uses that order, but the asynchronous UNWATCH branch sends the token first. Dropping a bound watch therefore sends a different unregister identity.Change
Encode UNWATCH as path followed by token. Add a regression using the actual socket reader, request processor and client watch API through a Unix socket pair. It registers two watches, drops one, and checks that removal repeats the original registration payload while the other watch and connection remain usable.
The fixture also checks request IDs, transaction context, interleaved watch events and out-of-order read replies. Cleanup is bounded and shuts down the reader on failure.
Verification
On base
c6982138ce0bbdc5fddfc76a10efb4776682563e, the identical test fails at the payload-identity assertion. It passes with this patch.cargo test --locked -p krata-xenstore --lib bus::tests::unwatch_preserves_watch_identity -- --exact --nocapturecargo test --locked -p krata-xenstorecargo fmt --all -- --checkRun natively on macOS arm64 with Rust 1.97.1. The peer supplies synthetic protocol replies; this does not test a real Xenstore server or Linux/Xen integration.
Protocol reference: https://xenbits.xen.org/docs/unstable/misc/xenstore.txt