fix: structured timeout detection in hiroz-py subscriber recv (#224)#225
Merged
Conversation
Map flume::RecvTimeoutError::Timeout to the structured Error::Timeout at the core level (ZSub::recv_timeout / recv_serialized_timeout / dynamic recv), and replace the string-sniffing timeout checks in hiroz-py's recv/recv_serialized/recv_raw_view with is_timeout().
The -F rmw clippy pass (jazzy/kilted/lyrical CI) does not enable the optional hiroz-msgs dep, so the unguarded `use hiroz_msgs::std_msgs` failed with E0432. Gate the file with #![cfg(feature = "ros-msgs")] like the sibling interop tests (cache.rs).
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
The Python bindings' subscriber receive paths detected timeouts by string-matching error messages (
err_str.contains("timeout")), the same fragility that #221 removed from the service and action paths. Any rewording of an error message would silently turn an expected timeout into an exception. This routes subscriber timeouts through the structuredError::Timeout/hiroz::error::is_timeout()path instead. Closes #224.Key Changes
flume::RecvTimeoutError::Timeoutto the structuredError::Timeoutat the core level (crates/hiroz/src/pubsub.rs,crates/hiroz-py/src/traits.rs).err_str.contains("timeout")checks incrates/hiroz-py/src/pubsub.rs(recv,recv_serialized,recv_raw_view) withhiroz::error::is_timeout(), passing the whole error (&*e) so its fullsource()chain is walked — consistent with the sibling service path intraits.rs.crates/hiroz-tests/tests/subscriber_timeout.rsasserting that subscriber recv timeouts are classified structurally rather than by string match.Breaking Changes
None.