[PR #4925] [CLOSED] fix(process): retain kernel-limit descriptor cleanup leases #6678

Closed
opened 2026-11-01 21:42:14 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/4925
Author: @evenafterallisaid
Created: 10/18/2026
Status: ❌ Closed

Base: main ← Head: fix/linux-kernel-descriptor-owner


📝 Commits (1)

  • a9ab95a fix(process): retain kernel-limit descriptor cleanup leases

📊 Changes

2 files changed (+145 additions, -34 deletions)

View changed files

📝 src/process/LinuxResourceLimits.ts (+17 -34)
➕ tests/process-global/kernelLimitCleanup.test.ts (+128 -0)

📄 Description

Linux capture CI fails its kernel-descriptor recovery cases on both main and #4894.

readLinuxResourceLimits retains a failed file close in its scope but projects only cleanup text/resources. ArtifactAnalysisResources therefore receives no exact retry capability and correctly refuses to treat an empty scope as proof of release, leaving an unrecoverable placeholder even after the actual descriptor closes.

the reader now uses the existing withArtifactFileHandle boundary. that owner carries the physical read/parse outcome and exact cleanup lease together. replacement work can retry the original descriptor, and the original error's live cleanup status clears after confirmed release. the duplicate manual finally/cleanup projection is removed. the bounded kernel-report read and configured limits remain in their existing owner.

executed validation

  • all 3 new controls fail on base e6c487799 and pass with the patch: blocked replacement acquisition followed by exact-owner retry, completed read plus close failure, and malformed report plus close failure without a resource scope.
  • 35 tests passed across 4 suites on Windows 11 Home/Node 24.18.0. actual file handles and the shared close-denial fixture are used; only /proc/self/limits is redirected to an authored report. this does not establish native Linux kernel behavior or naturally occurring close failure.
  • the 7 Linux-only capture integration cases are skipped on this Windows host; hosted Linux verification remains pending.
  • npm run check:fast passed typecheck and lint. npm run check:ci is blocked by an inherited formatting error in unchanged src/domain/propertyListXml.test.ts; no full-gate pass is claimed.

no provider capability, process authority, or package change. performance/token effects were not measured; this is a cleanup correctness repair.

Author readiness

Human owner: @evenafterallisaid

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

🔄 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/4925 **Author:** [@evenafterallisaid](https://github.com/evenafterallisaid) **Created:** 10/18/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/linux-kernel-descriptor-owner` --- ### 📝 Commits (1) - [`a9ab95a`](https://github.com/morluto/rea/commit/a9ab95a0923f1631a2a44d33e65bdd497d16c4ab) fix(process): retain kernel-limit descriptor cleanup leases ### 📊 Changes **2 files changed** (+145 additions, -34 deletions) <details> <summary>View changed files</summary> 📝 `src/process/LinuxResourceLimits.ts` (+17 -34) ➕ `tests/process-global/kernelLimitCleanup.test.ts` (+128 -0) </details> ### 📄 Description Linux capture CI fails its kernel-descriptor recovery cases on both [main](https://github.com/morluto/rea/actions/runs/39080907460/job/117538056696) and [#4894](https://github.com/morluto/rea/actions/runs/39073821613/job/117516997156). `readLinuxResourceLimits` retains a failed file close in its scope but projects only cleanup text/resources. `ArtifactAnalysisResources` therefore receives no exact retry capability and correctly refuses to treat an empty scope as proof of release, leaving an unrecoverable placeholder even after the actual descriptor closes. the reader now uses the existing `withArtifactFileHandle` boundary. that owner carries the physical read/parse outcome and exact cleanup lease together. replacement work can retry the original descriptor, and the original error's live cleanup status clears after confirmed release. the duplicate manual finally/cleanup projection is removed. the bounded kernel-report read and configured limits remain in their existing owner. ## executed validation - all 3 new controls fail on base `e6c487799` and pass with the patch: blocked replacement acquisition followed by exact-owner retry, completed read plus close failure, and malformed report plus close failure without a resource scope. - 35 tests passed across 4 suites on Windows 11 Home/Node 24.18.0. actual file handles and the shared close-denial fixture are used; only `/proc/self/limits` is redirected to an authored report. this does not establish native Linux kernel behavior or naturally occurring close failure. - the 7 Linux-only capture integration cases are skipped on this Windows host; hosted Linux verification remains pending. - `npm run check:fast` passed typecheck and lint. `npm run check:ci` is blocked by an inherited formatting error in unchanged `src/domain/propertyListXml.test.ts`; no full-gate pass is claimed. no provider capability, process authority, or package change. performance/token effects were not measured; this is a cleanup correctness repair. ## Author readiness Human owner: @evenafterallisaid - [ ] I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work. - [ ] I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps. - [ ] I declare this PR ready for initial maintainer review. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-01 21:42:14 +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#6678
No description provided.