fix(cpu-profile): unique cpuprofile names + diagnostic logging#110
Merged
Conversation
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
2 tasks
JohnMcLear
added a commit
that referenced
this pull request
May 16, 2026
The previous workflow exported NODE_OPTIONS=--cpu-prof and ran `pnpm run prod`, producing 5 cpuprofile files (one per Node process in the pnpm → cross-env → tsx chain). The pgrep-based SUT pid capture matched the tsx wrapper rather than the actual server.ts process — analysis of run 25956220071 showed pid 2636 (pnpm) blocked in spawnSync for 113s while the recorded sut pid 2684 (tsx) was 99.8% idle. Invoke node directly with the same args the prod script uses (`node --require tsx/cjs node/server.ts`) under --cpu-prof, set NODE_ENV inline, and record the SUT pid via `$!` so there's exactly one process to profile and stop. The earlier --cpu-prof-name pid-suffix fix from PR #110 is retained. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Run 25956064101 captured the cross-env wrapper's boot profile because both the wrapper and the real SUT inherited NODE_OPTIONS=--cpu-prof and shared the fixed --cpu-prof-name filename. Drop the fixed name so Node uses its default pid-suffixed name (CPU.....cpuprofile), and log per-file sizes so the analyst can pick the SUT (largest file). Also capture the SUT pid in a sidecar file for unambiguous identification.