Repository navigation
feat(hiroz-py): add a buffer_group argument - #388
Merged
Merged
Conversation
|
Codecov Report✅ All modified and coverable lines are covered by tests.
... and 1 file with indirect coverage changes 🚀 New features to boost your workflow:
|
This was referenced Oct 20, 2026
Closed
create_subscriber takes buffer_group as 'auto', 'cpu' or 'off', default 'auto'. Any other string raises ValueError. The action client status subscriber now stays out of the buffer group, since its message has no buffer. The feedback subscriber still joins under Auto.
Python tests cover the accepted values, the errors and delivery. A second file reads the liveliness token and writes the group key from a plain Zenoh session, for off, cpu, auto and the omitted default in the queue and callback forms. The action client test now expects the status subscriber to stay out.
YuanYuYuan
force-pushed
the
feat/py-buffer-group
branch
from
October 23, 2026 17:59
9fa2559 to
16eaff6
Compare
The policy tests detect incorrect joining but cannot tell auto from cpu. An off subscriber keeps its token without the backends part. Two comments repeated their code or their name.
The private parser helper needs no doc comment, and the policy test docstring no longer lists failure variants.
Drop the duplicate quiet-put helper and the narrating comments, fold the stub default check into test_pep561, and give each fact in the interop guide its own bullet.
A transient-local subscriber reads its history from the base key, so it stays out of the group under every setting. The guide now states the rmw_zenoh_cpp behavior with pinned source links.
The sentence said an unreleased rmw_zenoh_cpp revision serves transient-local history on the group key. That revision predates the gate that keeps transient-local endpoints off buffer endpoints, so rolling no longer behaves that way.
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 Python
create_subscribercannot stay out of the CPU buffer group ofrmw_zenoh_cpp. A subscriber that joins declares a second subscription and announces a buffer backend. On a topic that is known to carry no buffer, the extra subscription has no use. Python has no way to opt out. Under the defaultAutoof #384 a Python subscriber joins regardless of message type, except with transient-local QoS. The Python bindings build a subscriber with no message schema, so the message type cannot decide.A joined subscriber subscribes to
<topic key>(the base key) and to<topic key>/_buf_cpu(the group key), and its liveliness token ends withbackends:cpu:. See ros2/rmw_zenoh#930. The interop guide gives the rules and the cases that never join.Part of #370.
What changes
buffer_group='auto' | 'cpu' | 'off'oncreate_subscriber, in the queue form and the callback form. The default is'auto'. A Python subscriber has no message schema, so'auto'and'cpu'do the same.ValueError. A non-string raisesTypeError. Both namebuffer_group.Off), because its message has no buffer. The feedback subscriber still joins and has no switch.Before and after
A transient-local subscriber never joins, because its history comes from the base key, as in
rmw_zenoh_cpp; the interop guide gives the details. The rows below assume volatile QoS.create_subscriber, defaultbuffer_group='cpu'buffer_group='off'backends:cpu:buffer_group='other'ValueErrorCompatibility
A default-deny router that allows only the base key starves a joined Python subscriber of a buffer-aware publisher, with no error. Allow both keys.
buffer_group='off'needs no group key. A subscriber with nobackends:field gets no buffer message from a buffer-aware publisher. This holds until a release carries ros2/rmw_zenoh#1078, so'off'does not bring those messages back.Tests
test_create_subscriber_rejects_unknown_group,test_create_subscriber_rejects_a_non_string_groupValueError. A non-string raisesTypeErrortest_policy_takes_effect'off','cpu','auto', omitted) in two forms (queue, callback): the token and the group-key delivery match the value. Positive controls show that a cpu twin joins and that a put on the base key arrivesaction_client_join_policy(buffer_cpu_group.rs)The Python tests are in
crates/hiroz-py/tests.Merge order: this PR depends on no open PR and merges on its own. #386 merges last, because it bumps the release.