Repository navigation
Description
Command
build
Is this a regression?
- Yes, this behavior used to work in the previous version
The previous version in which this bug was not present was
19.2.2
Description
After upgrading to Angular 20, our CI starts crashing when building the application for production:
❯ Building...
/home/runner/_work/clickup_frontend/clickup_frontend/node_modules/.pnpm/[email protected]/node_modules/piscina/src/index.ts:447
assert.strictEqual(workerInfo.currentUsage(), 0);
^
AssertionError [ERR_ASSERTION]: Expected values to be strictly equal:
1 !== 0
at Timeout._onTimeout (/home/runner/_work/clickup_frontend/clickup_frontend/node_modules/.pnpm/[email protected]/node_modules/piscina/src/index.ts:447:16)
at listOnTimeout (node:internal/timers:588:17)
at processTimers (node:internal/timers:523:7) {
generatedMessage: true,
code: 'ERR_ASSERTION',
actual: 1,
expected: 0,
operator: 'strictEqual'
}
The assertion is being thrown from the piscina dependency here:
https://github.com/piscinajs/piscina/blob/fe781d66040eb87446692a3f7056c9c2c7b84a4a/src/index.ts#L447 which was added in 4.9.0 by piscinajs/piscina#590 (angular 19 uses 4.8.0 which was why this is not a problem until now)
We patched our version of the angular CLI to bump the idleTimeout here to be 10_000, and that seems to have resolved it:
| idleTimeout: 1000, |
Would you accept a PR to apply that patch? (or maybe it could be Infinity to disable this check completely? I'm unsure what the consequences of that change would be though)
I assume the issue is because our application source code is so large that it takes longer than 1s for the worker to initialise, and that timeout is hit.
Minimal Reproduction
A minimal repro is not possible as:
- The problem does not always occur (presumably because the worker sometimes initialises under the current 1s idle timeout)
- The problem only occurs on resource constrained hardware (it cannot be reproduced locally on an M3 macbook, and only within github actions)
- The problem only seems to affect large applications (100mb+ of source code). Our smaller applications do not suffer with this problem
Exception or Error
Your Environment
Angular CLI `20.0.2` + framework `20.0.3`
Anything else relevant?
No response
Activity
sod commentedon Jun 17, 2025
Had the same. No reproduction yet though. Just wanted to voice you aren't the only one. node 22.16, angular 20.0.2
alan-agius4 commentedon Jun 17, 2025
There appears to be a race condition within Piscina where the worker idle timeout isn't being cleared before the worker is re-used and becomes active.
While we could increase the idle timeout value as a temporary workaround until it is fixed upstream, setting it to
Infinityis not ideal. Doing so would prevent idle workers from ever being terminated, leading to persistent resource consumption especially in watch mode.I opened an issue upstream: piscinajs/piscina#816
[-]CI crash after upgrading to angular 20[/-][+]CI crash after upgrading to angular 20 `assert.strictEqual(workerInfo.currentUsage(), 0)`[/+]bryanrideshark commentedon Jun 17, 2025
I'm failing to understand why they had that assert in their original logic - seems like changing that behavior would solve the whole thing.
alan-agius4 commentedon Jun 17, 2025
@bryanrideshark, replied piscinajs/piscina#816 (comment)
fix(@angular/build): increase worker idle timeout
fix(@angular/build): increase worker idle timeout
fix(@angular/build): increase worker idle timeout
angular-automatic-lock-bot commentedon Jul 19, 2025
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.