Fix high CPU/RAM load handling and EPIPE errors#1322
Open
konard wants to merge 4 commits into
Open
Conversation
Adding CLAUDE.md with task information for AI processing. This file will be removed when the task is complete. Issue: #1317
This commit addresses issues discovered during investigation of #1317: 1. Add EPIPE error handling in exit-handler.lib.mjs: - Properly handle EPIPE errors that occur when writing to closed pipes - Add SIGPIPE signal handler for graceful shutdown on pipe breaks - These errors typically happen when child processes are killed by the OOM killer under high memory pressure 2. Add URL validation in log-upload.lib.mjs: - Detect malformed URLs returned by gh-upload-log (like github.com//repo) - This catches cases where network issues cause gh-upload-log to fail to get the GitHub username, resulting in invalid repository URLs 3. Add resource checking before auto-restart in solve.watch.lib.mjs: - Check RAM availability (512MB minimum) before starting auto-restart - Skip iteration if resources are too low to prevent OOM kills - Log resource state (memory, load) when skipping - Wait 30 seconds before next check to allow system recovery Root cause analysis: - System had 117MB free RAM with load average of 332 - Claude process was killed by OOM killer (exit code 137) - Network operations timed out due to high system load - gh-upload-log failed to get GitHub user, creating invalid URLs - EPIPE errors occurred when trying to write to killed processes Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
konard
marked this pull request as ready for review
February 17, 2026 19:52
This reverts commit c36e9b0.
Contributor
Author
🤖 Solution Draft LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost estimation:
Now working session is ended, feel free to review and add any feedback on the solution draft. |
Contributor
Author
✅ Ready to mergeThis pull request is now ready to be merged:
Monitored by hive-mind with --auto-restart-until-mergeable flag |
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.
Summary
This PR addresses issues discovered during investigation of #1317 ("Something strange happening on high CPU/RAM load").
Root Cause Analysis
From the log file analysis:
System Resources at Failure Time:
MemFree: 117072 kB(~114 MB free - CRITICALLY LOW!)332.51 341.45 350.83(EXTREMELY HIGH - system completely overloaded)Compared to Normal Operation (earlier in the same session):
MemFree: 5996068 kB(~5.7 GB free)1.18 0.39 0.17What Happened:
gh-upload-logfailed to get the GitHub user, creating an invalid URL (https://github.com//repo)Why
solveFailed but Manualgh-upload-logSucceededThe difference was timing:
solveran during the high-load period → network timeouts, OOM killsgh-upload-logran later after system load subsided → successBug in gh-upload-log
Found a bug in
gh-upload-log@0.6.0where network failures during user lookup cause malformed URLs. This should be reported to https://github.com/link-foundation/gh-upload-log separately.Changes Made
1. EPIPE Error Handling (
src/exit-handler.lib.mjs)2. URL Validation (
src/log-upload.lib.mjs)github.com//repo)3. Resource Checking Before Auto-restart (
src/solve.watch.lib.mjs)Test Plan
node -e "process.stdout.write('test'); process.exit(0)" | head -c 1Fixes #1317
This PR was created with assistance from the AI issue solver