Repository navigation
fix(foundation): absorb the pyshark crash a reaped tshark causes on Python 3.9–3.12 - #2642
Conversation
|
GOOD TO GO at |
be29223 to
06ae67a
Compare
|
Fix round:
Verdict stays good to go. |
|
NEEDS CHANGES at
A fix round is in progress. CI on this head is cancelled until then. |
06ae67a to
b3346a3
Compare
|
Fix round and rebase:
GOOD TO GO at |
|
The red |
|
Coverage: 94.08% -- tests failure, so this is partial (unit tier, Python 3.15,
Per-file detail: the |
|
Let's make no Python version gate on this behaviour. |
b3346a3 to
b4c2f2a
Compare
|
Rebased onto |
|
The owner asks, paraphrased, for the reaped-tshark absorption to run on every Python version. I posted the rebase note above without reading this first. That note's "good to go" was wrong, and I've edited it. The label is |
b4c2f2a to
fdfadc5
Compare
|
Fix round:
The label is |
|
NEEDS CHANGES at
CI on this head is cancelled until the fix round lands. |
…o lost (#2633) - A Popen.poll that reaps tshark before the event loop handles its SIGCHLD leaves asyncio's child watcher no child, so it reports 255 and pyshark's close raises TSharkCrashException. pyshark hits it at end of file: on CPython 3.9-3.12 asyncio's kill polls through Popen.send_signal (gh-87744). - PyShark.close logs that crash at DEBUG instead, on every Python, only when the capture reached EOF and every listed tshark reports 255 to asyncio but 0 to the Popen that reaped it. A real failure, a 255 the Popen also read, or any other error still raises. The capture is emptied for its __del__. - Stub pyshark.capture.capture. New unit tests pair each absorbed crash with one that still raises, and lose real exit statuses to a real poll. 3.12, 4x100 natural + 40 widened extractions: 97 crashes before, 0 after.
fdfadc5 to
c76ed35
Compare
|
Fix round:
The label is |
|
GOOD TO GO at
|
…hecksums and PyShark's lost tshark status into 1.6.0 (#2449) - Breaking, in the HTTP entry: building HTTP from fields takes version= and from_data refuses a dict, where 1.5.x built HTTP/1.1 and took one; HTTPv1 refuses preface, which 1.5.x wrote ahead of the message (#2651). The versioned-base entry and the conventions entry point at it. - Folded into the checksum entry: IGMP and GRE verify and compute their checksums, verify_message, GRE's checksum_present, and a cut-short GRE frame reading INVALID (#2654). The contextvars entry drops in_fragment, private to the checksum module and in no release. - Fixed: the PyShark engine absorbs the TSharkCrashException asyncio's lost tshark exit status raises, on every Python (#2642). - No entry for the test-only #2592. - CHANGELOG.md regenerated; util/changelog_md.py --check passes.
make pylint,make mypy,make isort)make testpasses, and a test case covers the changeWhat is the purpose of your pull request?
fix— a bug fixDescription of your pull request and other information
On Python 3.9–3.12,
extract(engine='pyshark')raised a spuriousTSharkCrashException: … retcode: 255. The cause is CPython gh-87744: asyncio'skill()goes throughPopen.poll(), which reaps an already-exited tshark, so asyncio reports 255. The owner chose option 1 on #2633, soPyShark.close()now absorbs the crash only under a strict version of that option's condition:TSharkCrashException, matched by class;Popenholds the real status, 0.It then logs at DEBUG, clears the stale processes and finishes pyshark's close.
Requiring the
Popen's 0 is stricter than "255 at EOF". pyshark sets EOF after a mid-stream crash too, and a truncated capture with a real exit 14 would otherwise be absorbed; it still raises. One residual case is documented: a genuine exit 255 that the watcher reaps first reads as 0. asyncio's ownUnknown child processwarning still prints, but the extraction succeeds.Evidence:
Closes #2633