Skip to content

fix(transport): return error when payload exceeds batch size with fragmentation disabled#1201

Open
aki1770-del wants to merge 1 commit into
eclipse-zenoh:mainfrom
aki1770-del:fix/z-put-silent-ok-when-fragmentation-disabled-1200
Open

fix(transport): return error when payload exceeds batch size with fragmentation disabled#1201
aki1770-del wants to merge 1 commit into
eclipse-zenoh:mainfrom
aki1770-del:fix/z-put-silent-ok-when-fragmentation-disabled-1200

Conversation

@aki1770-del
Copy link
Copy Markdown

@aki1770-del aki1770-del commented Apr 11, 2026

Fixes #1200

Problem

When Z_FEATURE_FRAGMENTATION=0, _z_transport_tx_send_fragment() returned _Z_RES_OK even though the payload was never sent. The stub was a silent no-op, so z_put() and z_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):

  1. Return _Z_ERR_TRANSPORT_NO_SPACE from the disabled-fragmentation stub instead of _Z_RES_OK.
  2. Upgrade the log level from _Z_INFO to _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, internal

This section updates automatically when labels change.

…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] z_put() silently returns Z_OK when payload exceeds batch size and Z_FEATURE_FRAGMENTATION=0

1 participant