[PR #2643] [MERGED] fix(process): preserve discovery ownership across cleanup retries #5301

Closed
opened 2026-10-31 01:05:34 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/2643
Author: @N0zoM1z0
Created: 10/13/2026
Status: ✅ Merged
Merged: 10/13/2026
Merged by: @N0zoM1z0

Base: main ← Head: fix/packet-fields-cleanup-2496-20261013


📝 Commits (9)

  • d5e5ef0 fix(captures): preserve descriptor ownership across cleanup retries
  • b2febfc fix(signals): preserve discovery ownership after main integration
  • f1b9993 test(captures): verify ownership after descriptor recovery
  • a89096f test(process): share descriptor cleanup failure fixtures
  • 5062b9d chore: synchronize discovery cleanup with repaired main checks
  • e74903c chore: preserve unrelated upstream test expression
  • 4548024 chore: synchronize discovery cleanup with repaired JavaScript baseline
  • 8b124aa chore: synchronize discovery cleanup with repaired release checks
  • 633c2c9 chore: synchronize discovery cleanup with portable dyld fixtures

📊 Changes

7 files changed (+220 additions, -82 deletions)

View changed files

📝 src/captures/TsharkCaptureProvider.ts (+2 -2)
📝 src/process/ArtifactAnalysisResources.ts (+29 -11)
📝 src/signals/SigrokRecordingProvider.ts (+2 -2)
📝 tests/boundary/captures/captureDescriptorCleanup.test.ts (+56 -34)
📝 tests/boundary/captures/captureProvider.test.ts (+34 -0)
📝 tests/boundary/signals/recordingDescriptorCleanup.test.ts (+32 -33)
➕ tests/fixtures/descriptorCloseFailure.ts (+65 -0)

📄 Description

When discovery leaves a descriptor whose cleanup fails, a later capture/decoding request or provider shutdown can report the wrong owning operation. Bind operation identity to the descriptor scope until pending cleanup succeeds, then bind the newly admitted request. Runtime resources inherit that owner; both providers stop passing redundant operation arguments.

Follow-up to merged #2496 and #2487. Coverage exercises actual retained file descriptors, failed cross-operation retries, successful recovery into a new operation, subsequent cleanup failure, cancellation, partial Evidence and public CLI error projection. Shared descriptor failure fixtures remove repeated test mechanics while preserving every scenario.

Validation on final synchronized head 633c2c928 (main fb28ec15): all 143 focused capture/signal/CLI, JavaScript provenance, release preflight, required-lane and dyld CLI tests pass. npm run check:ci passes, including duplication (2.97%), typecheck, lint, format, Knip, metadata, TODO and architecture checks. Earlier complete capture/signal/PCAP/CLI/MCP workflows and actual TShark 4.0.17 (23 cases) and sigrok-cli 0.7.2 (16 cases) verifiers passed. The recorded TLS/DNS workflow matched independent native glossary/dissection output with unchanged input hashes.

Discovery output, paging and native limits are unchanged. Each request freshly probes its producer; no persistent cache is added. Equivalent broad/focused DNS discovery-and-read tasks measured 41,449/5,878 request-response o200k tokens across three alternating warm-server pairs (not billing estimates). Verification uses two CPU cores and a monitored 8 GiB process-family limit; the maximum observed RSS was 5,463 MiB. Native macOS/Windows provider support is unchanged.

Independent main CI baseline fixes are integrated rather than reimplemented here: the malformed IDA fixture, stale JavaScript parameter assertion, release test schema for reusable workflow jobs, and the x64-admissible same-named dyld slice fixture (#2755). Their reproduced failures and attribution are documented in PR comments. The final feature diff remains seven related files.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/2643 **Author:** [@N0zoM1z0](https://github.com/N0zoM1z0) **Created:** 10/13/2026 **Status:** ✅ Merged **Merged:** 10/13/2026 **Merged by:** [@N0zoM1z0](https://github.com/N0zoM1z0) **Base:** `main` ← **Head:** `fix/packet-fields-cleanup-2496-20261013` --- ### 📝 Commits (9) - [`d5e5ef0`](https://github.com/morluto/rea/commit/d5e5ef0f4ec4527f53ff7e9170fbba6268c8a770) fix(captures): preserve descriptor ownership across cleanup retries - [`b2febfc`](https://github.com/morluto/rea/commit/b2febfce67ad44d2d303d37b335219c0459ac6e8) fix(signals): preserve discovery ownership after main integration - [`f1b9993`](https://github.com/morluto/rea/commit/f1b999353ddcde0caa34a3deabf356ee65da419b) test(captures): verify ownership after descriptor recovery - [`a89096f`](https://github.com/morluto/rea/commit/a89096f036151be30a375ff921f349ac5bdb7a37) test(process): share descriptor cleanup failure fixtures - [`5062b9d`](https://github.com/morluto/rea/commit/5062b9dbdebb78e5ee3a0bff34e38c0f18b7018a) chore: synchronize discovery cleanup with repaired main checks - [`e74903c`](https://github.com/morluto/rea/commit/e74903c6da4da53ef1e07b234956ee9094540f85) chore: preserve unrelated upstream test expression - [`4548024`](https://github.com/morluto/rea/commit/45480240730f7d167930d36911bd8ebd51a92998) chore: synchronize discovery cleanup with repaired JavaScript baseline - [`8b124aa`](https://github.com/morluto/rea/commit/8b124aa55184f2dfce449b20b18ed6c3f3af2f9f) chore: synchronize discovery cleanup with repaired release checks - [`633c2c9`](https://github.com/morluto/rea/commit/633c2c928a2d90f075b3c51d9f8ceab4f9d06351) chore: synchronize discovery cleanup with portable dyld fixtures ### 📊 Changes **7 files changed** (+220 additions, -82 deletions) <details> <summary>View changed files</summary> 📝 `src/captures/TsharkCaptureProvider.ts` (+2 -2) 📝 `src/process/ArtifactAnalysisResources.ts` (+29 -11) 📝 `src/signals/SigrokRecordingProvider.ts` (+2 -2) 📝 `tests/boundary/captures/captureDescriptorCleanup.test.ts` (+56 -34) 📝 `tests/boundary/captures/captureProvider.test.ts` (+34 -0) 📝 `tests/boundary/signals/recordingDescriptorCleanup.test.ts` (+32 -33) ➕ `tests/fixtures/descriptorCloseFailure.ts` (+65 -0) </details> ### 📄 Description When discovery leaves a descriptor whose cleanup fails, a later capture/decoding request or provider shutdown can report the wrong owning operation. Bind operation identity to the descriptor scope until pending cleanup succeeds, then bind the newly admitted request. Runtime resources inherit that owner; both providers stop passing redundant operation arguments. Follow-up to merged #2496 and #2487. Coverage exercises actual retained file descriptors, failed cross-operation retries, successful recovery into a new operation, subsequent cleanup failure, cancellation, partial Evidence and public CLI error projection. Shared descriptor failure fixtures remove repeated test mechanics while preserving every scenario. Validation on final synchronized head 633c2c928 (main fb28ec15): all 143 focused capture/signal/CLI, JavaScript provenance, release preflight, required-lane and dyld CLI tests pass. npm run check:ci passes, including duplication (2.97%), typecheck, lint, format, Knip, metadata, TODO and architecture checks. Earlier complete capture/signal/PCAP/CLI/MCP workflows and actual TShark 4.0.17 (23 cases) and sigrok-cli 0.7.2 (16 cases) verifiers passed. The recorded TLS/DNS workflow matched independent native glossary/dissection output with unchanged input hashes. Discovery output, paging and native limits are unchanged. Each request freshly probes its producer; no persistent cache is added. Equivalent broad/focused DNS discovery-and-read tasks measured 41,449/5,878 request-response o200k tokens across three alternating warm-server pairs (not billing estimates). Verification uses two CPU cores and a monitored 8 GiB process-family limit; the maximum observed RSS was 5,463 MiB. Native macOS/Windows provider support is unchanged. Independent main CI baseline fixes are integrated rather than reimplemented here: the malformed IDA fixture, stale JavaScript parameter assertion, release test schema for reusable workflow jobs, and the x64-admissible same-named dyld slice fixture (#2755). Their reproduced failures and attribution are documented in PR comments. The final feature diff remains seven related files. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 01:05:34 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#5301
No description provided.