fix: stats semver wire alignment using a zero sentinel#3036
Open
atharvalade wants to merge 4 commits intoapache:masterfrom
Open
fix: stats semver wire alignment using a zero sentinel#3036atharvalade wants to merge 4 commits intoapache:masterfrom
atharvalade wants to merge 4 commits intoapache:masterfrom
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3036 +/- ##
============================================
- Coverage 71.74% 71.74% -0.01%
Complexity 943 943
============================================
Files 1121 1121
Lines 93800 93795 -5
Branches 71124 71130 +6
============================================
- Hits 67301 67291 -10
+ Misses 23863 23852 -11
- Partials 2636 2652 +16
🚀 New features to boost your workflow:
|
mmodzelewski
requested changes
Mar 27, 2026
f617351 to
ad1fa0a
Compare
mmodzelewski
approved these changes
Mar 28, 2026
krishvishal
approved these changes
Mar 29, 2026
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.
Which issue does this PR close?
Closes #2979
Rationale
Stats wire encoding could omit
iggy_server_semverwhenNone, while multiple deserializers assume a fixed 4-byte semver slot (0sentinel), risking downstream field misalignment.What changed?
When semver was
None, the binary stats encoder could skip semver bytes (and in protocol encoder also skip tail fields), which could shift subsequent fields for decoders expecting fixed layout.Now semver is always encoded as 4 bytes using
0as the sentinel forNone, and tail fields (threads_count,free_disk_space,total_disk_space) are always encoded.The stats decoder now normalizes semver
0back toNone, and tests were updated/added to lock this layout and sentinel behavior.Local Execution
AI Usage
cargo fmt --check,cargo clippy, targetedcargo test -p iggy_binary_protocol responses::system::get_stats, and repository CI scripts for trailing whitespace/newline and license headers