Skip to content

Keep processing dumps with missing timestamps - #13850

Open
tmt-123 wants to merge 1 commit into
apache:masterfrom
tmt-123:fix/traffic-dump-missing-timestamps
Open

tmt-123 wants to merge 1 commit into
apache:masterfrom
tmt-123:fix/traffic-dump-missing-timestamps

Conversation

@tmt-123

@tmt-123 tmt-123 commented Oct 16, 2026 •

Copy link
Copy Markdown

Problem

While skipping an incomplete session, the traffic_dump post-processor
indexes optional connection-time and start-time fields in its diagnostic
path. Missing fields can raise a second exception and terminate the worker
before pending and subsequent valid sessions are written. The CLI can
still return success with an incomplete output summary.

For example, an incomplete session such as {"transactions": []}
raises a verification error, but the diagnostic handler then raises
KeyError: 'connection-time'. With valid sessions before and after this
entry, the worker can exit before writing either valid session, while
the CLI still exits with status 0.

Changes

Read optional timestamps safely and use the resolved value in the log
message. Preserve the existing behavior of skipping incomplete sessions.

Add function and CLI regressions that retain distinct valid sessions
before and after invalid entries. Check the output JSON, session and
transaction counts, and absence of worker-thread exceptions. Also verify
that the legacy start-time fallback is logged correctly.

Register the Python test with CTest when a Python 3.11+ interpreter is
available.

Validation

  • Base: d6b47e7.
  • Tested in Debian 12 Docker on x86_64, GCC 12.2.0, CMake 3.25.1,
    and Python 3.11.2.
  • The final regression suite fails against the original script with
    five subtest failures and five subtest errors. All three test methods
    pass after the fix.
  • Full ATS build and installation passed.
  • Full CTest: 1135/1135 passed, including the new Python test.
  • AuTests passed: traffic_dump, traffic_dump_ip_filter,
    traffic_dump_response_body, and traffic_dump_sni_filter.
  • traffic_dump_http3 was skipped because QUIC is disabled.
  • Project format target, the repository pre-commit checks, and
    git diff --check passed.
  • Not run: the full AuTest suite, sanitizer builds, and other platforms.

The regression test can be run directly from the repository root
with Python 3.11+:

python3 plugins/traffic_dump/unit_tests/test_post_process.py

The suite contains three test methods: a valid-session control,
plus function and CLI tests that each exercise six incomplete-session
variants: null, an empty object, missing timestamps, a legacy start-time
only, a zero connection-time, and a nonzero connection-time.

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.

1 participant