fix(transport): return error when payload exceeds batch size with fragmentation disabled#1201
Open
aki1770-del wants to merge 1 commit into
Conversation
…gmentation disabled When Z_FEATURE_FRAGMENTATION=0, _z_transport_tx_send_fragment() silently dropped the message but returned _Z_RES_OK, causing z_put() and z_publisher_put() to report success while the payload was never sent. Change the disabled-fragmentation stub to return _Z_ERR_TRANSPORT_NO_SPACE and upgrade the log from _Z_INFO to _Z_ERROR so callers can detect and handle the failure. Fixes eclipse-zenoh#1200 Co-Authored-By: Claude and aki1770-del <aki1770@gmail.com>
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.
Fixes #1200
Problem
When
Z_FEATURE_FRAGMENTATION=0,_z_transport_tx_send_fragment()returned_Z_RES_OKeven though the payload was never sent. The stub was a silent no-op, soz_put()andz_publisher_put()reported success while the message was silently dropped.This is a silent-failure: the caller has no way to distinguish a dropped put from a successful one, making the fragmentation-disabled build profile misleading for resource-constrained embedded targets.
Fix
Two changes in
src/transport/common/tx.c(2 lines):_Z_ERR_TRANSPORT_NO_SPACEfrom the disabled-fragmentation stub instead of_Z_RES_OK._Z_INFOto_Z_ERROR.No API surface changes. No behavior change when
Z_FEATURE_FRAGMENTATION=1.AI-assisted — authored with Claude, reviewed by Komada.
🏷️ Label-Based Checklist
No specific label requirements detected.
Current labels: No labels
Add one of these labels to this PR to see relevant checklist items:
api-sync,breaking-change,bug,ci,dependencies,documentation,enhancement,new feature,internalThis section updates automatically when labels change.