cpu-profile: invoke node directly (skip pnpm/cross-env wrappers)#111
Merged
Conversation
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>
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? |
JohnMcLear
added a commit
that referenced
this pull request
Jun 21, 2026
…ient 4.0.3 + rate-limit) (#122) * build(deps): bump actions/checkout from 4 to 7 Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 7. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](actions/checkout@v4...v7) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: '7' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> * fix(ci): restore sweep integration test against hardened core The sweep integration test (and thus all Backend-tests CI) has been red on every PR since ~2026-05-19; the last green run was #111 (2026-05-16). The break is not in this repo — ether/etherpad#7773 ("harden: reject USER_CHANGES inserts without an author attribute", merged 2026-05-16 17:23, just after the last green run) tightened server-side changeset validation and bumped its own etherpad-cli-client dependency to 4.0.3 to comply. This repo was still pinned to etherpad-cli-client 4.0.2, whose append() splices at text.length (stranding the trailing '\n') with an empty apool and no author attribute — exactly the two shapes #7773 now rejects as badChangeset. Result: zero ACCEPT_COMMITs, so every step's latency sample count is 0 and the test asserts `count > 0`. Two-part fix, both verified against a local core build at develop HEAD: - Bump etherpad-cli-client 4.0.2 -> 4.0.3 (sends author-attributed inserts and preserves the trailing newline). - Raise commitRateLimiting on the SUT in the sweep step. The sweep drives 2..4 authors from a single IP; core's default 10 changes/s/IP rate-limits the 4-author step (~20/s), and a rate-limited USER_CHANGES never gets an ACCEPT_COMMIT, stalling the cli-client's in-flight slot. Mirrors the importExportRateLimiting bump runnerLoadTest.sh already applies. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Claude Opus 4.8 (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.
Summary
pnpm run prodwithNODE_OPTIONS=--cpu-prof. The pnpm → cross-env → tsx chain produced 5 cpuprofile files; pgrep matched the tsx wrapper, which came back 99.8% idle, while pnpm itself dominated (99.7% inspawnSync).node --require tsx/cjs node/server.tsdirectly withNODE_ENV=productionand--cpu-prof --cpu-prof-dir=...so there is exactly one Node process under profile, and capture its pid via\$!instead ofpgrep.Continues the lever-8c CPU hotspot investigation for ether/etherpad#7756.
Test plan
CPU profile captureworkflow against develop..cpuprofilefile lands, and that it contains > 80% busy samples with stack frames insrc/node/....