fix(core): improve plugin worker error messages and lifecycle timeouts#34251
fix(core): improve plugin worker error messages and lifecycle timeouts#34251AgentEnder merged 5 commits intomasterfrom
Conversation
- Include plugin name in all error messages for easier debugging - Replace boolean-based connection timeout with `setErrorTimeout` helper that provides clearable, descriptive timeouts - Add `expectedPluginName` from argv to worker process for context - Fix missing `clearInterval` on rejection path in `startPluginWorker` - Reject with `Error` object instead of plain string for stack traces - Add `performance.mark`/`performance.measure` around worker startup - Fix "recieve" typo and missing sentence spacing in error message 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
- Replace `Promise.all` with `Promise.allSettled` in `loadSpecifiedNxPlugins`, `loadDefaultNxPlugins`, and `getPlugins` so every plugin error is collected rather than short-circuiting on the first failure - Throw `AggregateError` listing all failed plugins with their individual error messages - Clean up successfully started workers before throwing on failure - Rename shadowed `loadedPlugins` variable in `loadDefaultNxPlugins` to `defaultPluginResults` to avoid confusion with the module-level cache variable 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
✅ Deploy Preview for nx-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
View your CI Pipeline Execution ↗ for commit df5419d
☁️ Nx Cloud last updated this comment at |
Add 6 targeted `logger.verbose` calls (gated behind `NX_VERBOSE_LOGGING=true`) covering the 3 key worker lifecycle transitions from both host and worker perspectives: - Spawn: host logs PID + socket path; worker logs listening - Connect: host logs attempt count; worker logs connection - Load: host logs plugin name; worker logs successful load This enables bilateral tracing — if a transition fails, logs from the succeeding side pinpoint where the breakdown occurred. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
95ce9c5 to
4a4bc13
Compare
Co-authored-by: AgentEnder <[email protected]>
There was a problem hiding this comment.
✅ The fix from Nx Cloud was applied
We've updated the snapshot serializers in four e2e release test files to filter out the new plugin worker verbose logs introduced by this PR. The PR intentionally added lifecycle logging for plugin workers (spawn, connect, load events), which now appears in CLI output when using --verbose flags, causing snapshot mismatches in tests that capture this output.
Tip
✅ We verified this fix by re-running e2e-release:e2e-ci--src/version-plans-check.test.ts.
Suggested Fix changes
diff --git a/e2e/release/src/independent-projects.workspaces.test.ts b/e2e/release/src/independent-projects.workspaces.test.ts
index 907d090386..700cb94c77 100644
--- a/e2e/release/src/independent-projects.workspaces.test.ts
+++ b/e2e/release/src/independent-projects.workspaces.test.ts
@@ -54,6 +54,8 @@ expect.addSnapshotSerializer({
.replaceAll('pnpm install --lockfile-only', '{lock-file-command}')
.replaceAll(getSelectedPackageManager(), '{package-manager}')
.replaceAll(e2eRegistryUrl, '{registryUrl}')
+ // Filter out plugin worker verbose logs
+ .replaceAll(/\[plugin-(pool|worker)\].*\n/g, '')
// We trim each line to reduce the chances of snapshot flakiness
.split('\n')
.map((r) => r.trim())
diff --git a/e2e/release/src/preserve-local-dependency-protocols.test.ts b/e2e/release/src/preserve-local-dependency-protocols.test.ts
index e521081fa8..92ae5e7d8d 100644
--- a/e2e/release/src/preserve-local-dependency-protocols.test.ts
+++ b/e2e/release/src/preserve-local-dependency-protocols.test.ts
@@ -47,6 +47,8 @@ expect.addSnapshotSerializer({
/Integrity:\s*.*/g,
'Integrity: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
)
+ // Filter out plugin worker verbose logs
+ .replaceAll(/\[plugin-(pool|worker)\].*\n/g, '')
.split('\n')
.map((r) => r.trim())
diff --git a/e2e/release/src/version-plans-check.test.ts b/e2e/release/src/version-plans-check.test.ts
index cdef4819e8..b18aebe2c0 100644
--- a/e2e/release/src/version-plans-check.test.ts
+++ b/e2e/release/src/version-plans-check.test.ts
@@ -32,6 +32,8 @@ expect.addSnapshotSerializer({
.replaceAll(/Test @[\w\d]+/g, 'Test @{COMMIT_AUTHOR}')
// Normalize the version title date.
.replaceAll(/\(\d{4}-\d{2}-\d{2}\)/g, '(YYYY-MM-DD)')
+ // Filter out plugin worker verbose logs
+ .replaceAll(/\[plugin-(pool|worker)\].*\n/g, '')
// We trim each line to reduce the chances of snapshot flakiness
.split('\n')
.map((r) => r.trim())
diff --git a/e2e/release/src/version-plans-only-touched.test.ts b/e2e/release/src/version-plans-only-touched.test.ts
index 4d77dc183e..5ad43e01bd 100644
--- a/e2e/release/src/version-plans-only-touched.test.ts
+++ b/e2e/release/src/version-plans-only-touched.test.ts
@@ -29,6 +29,8 @@ expect.addSnapshotSerializer({
.replaceAll(/Test @[\w\d]+/g, 'Test @{COMMIT_AUTHOR}')
// Normalize the version title date.
.replaceAll(/\(\d{4}-\d{2}-\d{2}\)/g, '(YYYY-MM-DD)')
+ // Filter out plugin worker verbose logs
+ .replaceAll(/\[plugin-(pool|worker)\].*\n/g, '')
// We trim each line to reduce the chances of snapshot flakiness
.split('\n')
.map((r) => r.trim())
This fix was applied by Craigory Coppola
🎓 Learn more about Self-Healing CI on nx.dev
Co-authored-by: AgentEnder <[email protected]>
#34251) ## Current Behavior Plugin workers occasionally fall over during the start up steps. ## Expected Behavior Improves some issues with the error handling when loading plugin workers and adds some more logs to help understand what's went wrong here. ## Related Issue(s) <!-- Please link the issue being fixed so it gets closed when this is merged. --> Fixes # --------- Co-authored-by: Claude <[email protected]> Co-authored-by: nx-cloud[bot] <71083854+nx-cloud[bot]@users.noreply.github.com> Co-authored-by: AgentEnder <[email protected]> (cherry picked from commit 4f4b9dc)
|
This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request. |
Current Behavior
Plugin workers occasionally fall over during the start up steps.
Expected Behavior
Improves some issues with the error handling when loading plugin workers and adds some more logs to help understand what's went wrong here.
Related Issue(s)
Fixes #