Skip to content

c_glib: fix testbinaryprotocol expectation for non-versioned message headers - #3676

Merged
Jens-G merged 1 commit into
apache:masterfrom
Jens-G:cglib-oldstyle-message-test
Jul 27, 2026
Merged

c_glib: fix testbinaryprotocol expectation for non-versioned message headers#3676
Jens-G merged 1 commit into
apache:masterfrom
Jens-G:cglib-oldstyle-message-test

Conversation

@Jens-G

@Jens-G Jens-G commented Jul 27, 2026

Copy link
Copy Markdown
Member

testbinaryprotocol currently fails on master:

ERROR:lib/c_glib/test/testbinaryprotocol.c:726:thrift_server_complex_types:
  assertion failed: (thrift_binary_protocol_read_message_begin (...) > 0)

test_read_and_write_complex_types covers the case where the leading int32 of a
message is non-negative. The client wrote a bare int32 for it and the server
asserted that read_message_begin returned success — which it did, because the
function had no branch for the old-style (non-versioned) header and returned
without consuming a name, message type or sequence id.

Since 280d977 that branch exists, so the call now reads those three fields.
The four bytes the test wrote are no longer a complete message, the read fails,
and everything after it in the shared socket stream is misaligned, which is why
the failure shows up twice (once in the server child, once in the parent's
status == 0 assertion).

This sends a complete old-style header for that case — name length + name,
message type, sequence id — and verifies what the server read back, so the case
now exercises the branch it is named after and the stream stays in sync.

Verified with the c_glib suite via cmake in thrift:jammy: 20/20 pass, where
master is 19/20.

🤖 Generated with Claude Code

Client: c_glib

The complex-types round trip wrote a bare int32 for the non-versioned message
case and expected read_message_begin to return without consuming a name, type
and sequence id. read_message_begin reads them since commit 280d977, which
left the case failing and the rest of the stream misaligned. Send a complete
old-style header and verify what was read back.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@Jens-G
Jens-G requested a review from mhlakhani as a code owner July 27, 2026 21:47
@mergeable mergeable Bot added the c_glib label Jul 27, 2026
@Jens-G
Jens-G merged commit 18dccb9 into apache:master Jul 27, 2026
94 of 95 checks passed
@Jens-G
Jens-G deleted the cglib-oldstyle-message-test branch July 27, 2026 23:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant