fix: correct error type on timeout and prevent silent message loss on macOS#13
Open
hobostay wants to merge 1 commit into
Open
fix: correct error type on timeout and prevent silent message loss on macOS#13hobostay wants to merge 1 commit into
hobostay wants to merge 1 commit into
Conversation
… macOS 1. Fix incorrect JoinError type in Rule::join: when lookup times out after 5 retries, the code was returning VersionMismatch(0,0,0) instead of Timeout. 2. Fix silent message loss on macOS: when mach_msg_send fails with a non-retryable error and the remote is not dead, the code returned Ok(()) instead of Err(Error::Disconnect), causing the caller to incorrectly believe the message was sent. 3. Simplify bus controller buffer logic: the message_buffer_swap field was unnecessary since after mem::take, self.message_buffer is empty and can directly receive retained messages. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Member
|
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.
Summary
JoinErrortype inRule::join: When the lookup times out after 5 retries, the code was returningJoinError::VersionMismatch(Version((0, 0, 0)))instead ofJoinError::Timeout. This misleads callers into thinking there's a version mismatch when the real problem is a network/service timeout.platform/macos/mod.rs, whenmach_msg_sendfails with a non-retryable error and the remote is not dead, the code was returningOk(())instead ofErr(Error::Disconnect). This causes the caller (bus controller) to believe the message was sent successfully when it was actually dropped. Now returnsErr(Error::Disconnect)to be consistent with the Linux implementation.message_buffer_swapfield was redundant. Sincemem::takealready emptiesself.message_buffer, retained messages can be pushed directly to it without needing a swap buffer and the associatedmem::swapcall.Test plan
cargo test— 8 tests passed)mach_msg_senderror handling🤖 Generated with Claude Code