Conversation
- Introduce a new `lifecycleProbeEnabled` flag, activated by `BOKA_CHILD_PROCESS_TRACE=1` or `GITHUB_ACTIONS=true` environment variables. - Implement `lifecycleProbe` to log detailed events during child process lifecycle, including spawning, readiness checks, and exit waiting. - Enhance `sleepFor` to log the reason for sleeping, providing better context for delays. - This tracing mechanism is designed to help diagnose and prevent hangs observed in CI environments by providing granular insights into child process states and transitions.
There was a problem hiding this comment.
The changes introduce a tracing mechanism to debug child process lifecycle issues in CI, which is a valuable addition. However, there is a performance concern in the sleepFor method where the reason autoclosure is evaluated unconditionally, incurring string interpolation overhead even when tracing is disabled.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #396 +/- ##
==========================================
- Coverage 73.16% 72.11% -1.06%
==========================================
Files 441 440 -1
Lines 37440 37245 -195
==========================================
- Hits 27392 26858 -534
- Misses 10048 10387 +339 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
… executable resolution Removed `SandboxPoolTests.swift` as these tests were previously disabled due to unresolved issues with the sandbox's async runtime in forked child processes. Refactored `ChildProcessManagerTests.swift` to streamline the resolution of the sandbox executable. The test now directly utilizes `SandboxExecutableResolver` instead of manual environment variable management and a custom helper function. Added an assertion for a zero exit code to `waitForExit` in `ChildProcessManagerTests` for increased test robustness.
Removes the parity test for the JumpInd instruction (Opcode 50) from JITControlFlowTests.swift.
The sandbox can now be spawned in a "single-shot" mode, where it processes a single IPC request and then exits. This is enabled by passing the `--single-shot` argument to the sandbox executable. Refactored `ChildProcessManager` to correctly handle command-line arguments for spawned processes using duplicated C strings, ensuring safe and robust `execvp`/`posix_spawnp` calls. `ExecutorFrontendSandboxed` now utilizes the single-shot mode for sandbox workers, improving resource management and simplifying cleanup by expecting the sandbox to self-terminate. Updated `IPCServer` and `Sandbox/main.swift` to support and enable the single-shot behavior. Added a new test `singleShotSandboxExitsAfterReply` to verify the functionality of the single-shot mode. Modified `JITControlFlowTests` to test jump semantics more directly by jumping to a trap, rather than relying on gas exhaustion in a self-loop. Removed `sleepForCleanupDelay` and streamlined cleanup logic in `ExecutorFrontendSandboxed`.
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.
No description provided.