Skip to content

fix(rush): treat non-terminal statuses as non-terminal#5277

Merged
dmichon-msft merged 8 commits intomicrosoft:mainfrom
aramissennyeydd:sennyeya/fix-pnpm-sync
Jul 22, 2025
Merged

fix(rush): treat non-terminal statuses as non-terminal#5277
dmichon-msft merged 8 commits intomicrosoft:mainfrom
aramissennyeydd:sennyeya/fix-pnpm-sync

Conversation

@aramissennyeydd
Copy link
Contributor

Summary

The pnpm-sync plugin is triggering multiple times during cobuilds instead of a single time after a proper build. This may be contributing to an increased rate of Writer already closed errors that we've been seeing.

Details

While debugging a failure when turning on injected-deps and pnpm-sync, I came across a consistent Writer already closed error. I think this is due to pnpm-sync trying to write debug logs to a closed terminal (investigation still pending) - however, as part of my investigation, I saw pnpm-sync copying the same files over and over again with a log like


pnpm-sync: Starting operation for /packages/lib-doordash-api/node_modules/.pnpm-sync.json
--
  | pnpm-sync: Synced 101 files in 6 ms
  | Get completed_state()_package(@doordash/lib-dd-server)_phase(_phase:test): null
  | pnpm-sync: Starting operation for /packages/lib-dd-server/node_modules/.pnpm-sync.json
  | pnpm-sync: Synced 8 files in 1 ms
  | Get completed_state()_package(@doordash/lib-dd)_phase(_phase:test): null
  | pnpm-sync: Starting operation for /packages/lib-dd/node_modules/.pnpm-sync.json
  | pnpm-sync: Synced 20 files in 2 ms


I'm pretty confident this is caused by the afterExecuteOperation hook actually getting called for states like Executing and Waiting instead of only being called for terminal statuses.

How it was tested

Ran a cobuild against the sharded test repo we have and ran a cobuild locally and verified that I only saw pnpm-sync logs for completed operations instead of all cobuild attempts.

Impacted documentation

Signed-off-by: Aramis Sennyey <aramissennyeydd@users.noreply.github.com>
Signed-off-by: Aramis Sennyey <aramissennyeydd@users.noreply.github.com>
Signed-off-by: Aramis Sennyey <aramissennyeydd@users.noreply.github.com>
Signed-off-by: Aramis Sennyey <aramissennyeydd@users.noreply.github.com>
Signed-off-by: Aramis Sennyey <aramissennyeydd@users.noreply.github.com>
aramissennyeydd and others added 2 commits July 22, 2025 16:20
…ger.ts

Co-authored-by: David Michon <dmichon@microsoft.com>
Signed-off-by: Aramis Sennyey <aramissennyeydd@users.noreply.github.com>
@dmichon-msft dmichon-msft merged commit 87826c2 into microsoft:main Jul 22, 2025
5 checks passed
@github-project-automation github-project-automation bot moved this from Needs triage to Closed in Bug Triage Jul 22, 2025
@octogonz
Copy link
Collaborator

Thanks for fixing this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Closed

Development

Successfully merging this pull request may close these issues.

3 participants