Repository navigation
fix(traceflow): TCP flow labels are not unique, so a second flow with the same label truncates the first flow's file - #1371
Merged
Conversation
… the same label truncates the first flow's file A flow opened on the same endpoints at the same capture timestamp as an earlier flow now gets the earlier label suffixed with -1, -2, ..., so each flow keeps its own output file. Labels that do not collide are unchanged. Both the unidirectional (resumed after FIN) and the bidirectional (new connection on torn-down endpoints) paths collided, and both are fixed. Closes #1360
JarryShaw
marked this pull request as ready for review
October 7, 2026 21:25
Owner
Author
|
Cross-review verdict on
Nit: |
Contributor
|
Coverage: 88.98% (unit tier, Python 3.14,
Per-file detail: the |
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.
make pylint,make mypy,make isort) — Makefile flags ontraceflow/tcp.py: pylint 10.00/10, mypy clean, isort cleanmake testpasses, and a test case covers the change — modules listed belowdocs/source/changelog/and regeneratedCHANGELOG.md, if the change is user-visible — N/A, added centrallyWhat is the purpose of your pull request?
fix— corrects a defectDescription of your pull request and other information
Closes #1360
A new flow whose label an earlier flow already used now gets the next free suffix
-1,-2, ... (TCP._unique_label), so it opens its own file instead of truncating the earlier one. Non-colliding labels are unchanged. The bidirectional path collided too (a new SYN on torn-down endpoints at the same timestamp), and is fixed by the same change. Visible output change: a colliding flow'slabelandfpoutgain the suffix.Probe (frames at t=300.0), before → after:
…-300.0, one file holding Frame 2 →…-300.0(Frame 1) +…-300.0-1(Frame 2)…-300.0, one file holding Frame 4 →…-300.0(1-3) +…-300.0-1(4)Tests: new
tests/foundation/traceflow/test_traceflow_label_unique_unit.py4 passed; withtcp.pyfromorigin/main, 3 failed, 1 passed (the unchanged-label case).test_tcp15 passed,test_traceflow_base5,data/test_models1,integration/test_traceflow_end_to_end7;tests/project389 passed, 1 skipped.util/run_unittest_leg.py foundation(under a 200 MB file-size cap, per #1372): 487 tests, 2 failures, 2 errors, all pre-existing onmain— the DPKT and Scapytest_pcap_output_opens_with_the_global_header(Errno 27, #1372) and both subtests oftest_runtime_engines.py::PCAPEngineTests::test_pcap_run_writes_global_header_for_file_and_stream_modes.