Skip to content

Fix mismatched sINT/dINT log field types#13223

Open
masaori335 wants to merge 1 commit into
apache:masterfrom
masaori335:cleanup-logging
Open

Fix mismatched sINT/dINT log field types#13223
masaori335 wants to merge 1 commit into
apache:masterfrom
masaori335:cleanup-logging

Conversation

@masaori335
Copy link
Copy Markdown
Contributor

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

  • the field can't be used in a filter (dINT rejected)
  • can't be aggregated (requires sINT). So fields like cqssl (is-client-SSL, a clean 0/1) were silently un-filterable

I'm going to introduce a new binary logging format with self description of type, it depends on this fix.

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.
@masaori335 masaori335 added this to the 11.0.0 milestone Jun 2, 2026
@masaori335 masaori335 self-assigned this Jun 2, 2026
Copilot AI review requested due to automatic review settings June 2, 2026 07:53
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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::dINT to LogField::sINT to match their marshal_int() behavior.
  • Retype proxy_protocol_version (ppv) from LogField::dINT to LogField::STRING to match its string marshalling.
  • Add clarifying enum comments for LogField::Type values.

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.

@masaori335
Copy link
Copy Markdown
Contributor Author

[approve ci autest 2of4]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants