Fix mismatched sINT/dINT log field types#13223
Open
masaori335 wants to merge 1 commit into
Open
Conversation
Seven boolean/counter fields were declared dINT, but their marshal functions write a single int, and proxy_protocol_version (ppv) was declared dINT while it actually marshals a string. The dINT type wrongly excludes these fields from log filters and aggregates, and the ppv mislabeling misrepresents variable-length string bytes as two fixed ints to any type-driven consumer. Retype the single-int fields as sINT and ppv as STRING so the declared type matches what each marshal function emits.
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request corrects Apache Traffic Server’s access log field type declarations so they match what the corresponding marshal functions actually emit, which in turn restores expected behavior for type-driven consumers (e.g., filters/aggregates) and prevents incorrect interpretation in typed/binary contexts.
Changes:
- Retype seven single-int boolean/counter fields from
LogField::dINTtoLogField::sINTto match theirmarshal_int()behavior. - Retype
proxy_protocol_version(ppv) fromLogField::dINTtoLogField::STRINGto match its string marshalling. - Add clarifying enum comments for
LogField::Typevalues.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/proxy/logging/Log.cc | Updates the affected log field registrations to use sINT/STRING types consistent with their marshal functions. |
| include/proxy/logging/LogField.h | Adds brief documentation comments clarifying the meaning of sINT, dINT, and STRING. |
Contributor
Author
|
[approve ci autest 2of4] |
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.
Seven boolean/counter fields were declared dINT, but their marshal functions write a single int, and proxy_protocol_version (ppv) was declared dINT while it actually marshals a string. The dINT type wrongly excludes these fields from log filters and aggregates, and the ppv mislabeling misrepresents variable-length string bytes as two fixed ints to any type-driven consumer. Retype the single-int fields as sINT and ppv as STRING so the declared type matches what each marshal function emits.
What happens on mismatch
I'm going to introduce a new binary logging format with self description of type, it depends on this fix.