-
Notifications
You must be signed in to change notification settings - Fork 0
[node-core-library] Fix weighted oversubscription in forEachAsync #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
| let concurrentUnitsInProgress: number = 0; | ||
|
|
||
| const iterator: Iterator<TEntry> | AsyncIterator<TEntry> = (iterable as AsyncIterable<TEntry>)[ | ||
| const baseIterator: Iterator<TEntry> | AsyncIterator<TEntry> = (iterable as AsyncIterable<TEntry>)[ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Q: does this need to be of type Iterator<TEntry> | AsyncIterator<TEntry>? it looks like iterable is of type AsyncIterable<TEntry>,?
Can we simplify so we only have to contain types for AsyncIterator?
| expect(fn).toHaveBeenNthCalledWith(3, 3, 2); | ||
| }); | ||
|
|
||
| it('returns the same result as built-in Promise.all', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
duplicated test case
36c1370 to
18960cd
Compare
…ID (microsoft#5364) * Initial plan * Replace uuid package with Node.js built-in crypto.randomUUID Co-authored-by: bmiddha <5100938+bmiddha@users.noreply.github.com> * Add rush change file for uuid package replacement Co-authored-by: bmiddha <5100938+bmiddha@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: bmiddha <5100938+bmiddha@users.noreply.github.com>
…soft#5363) * Add edge case for projects with duplicate names * Replace custom interfaces with official PNPM types; temporarily remove the V6 kludge * Add lockfilePath.ts utility that can completely eliminate `@lifaon/path` * Completed rewrite of 5.4 loader logic * Remove "@lifaon/path" dependency * Splite createLockfileEntry() into createProjectLockfileEntry() and createPackageLockfileEntry() * Upgrade to use @pnpm/lockfile.types@1002.0.1 * Implement support for lockfile version 6.0 * Hide the "." package from Rush workspaces, shuffling the jsonId's in all the snapshots * Fix an incorrect path * rush change * Improve formatting of 6.0 suffixes * Move entry to nonbrowser-approved-packages.json * Add a failing test case for "link:" in packages section * PR feedback * PR feedback: don't try to resolve "link:" under packages section * rush update
Co-authored-by: David Michon <dmichon-msft@users.noreply.github.com>
* [rush-serve] Add dependencies to operations, support abort * Adjust "silent" field in socket --------- Co-authored-by: David Michon <dmichon-msft@users.noreply.github.com>
…ighlighter (microsoft#5366) * Enable syntax highlighting for pnpmfile.cjs tab * Highlight package.json as well * Introduce PnpmfileRunner.ts to isolate .pnpmfile.cjs execution * rush change * Disable webpack bundle size limits, since this app is served from localhost * In a Rush repo, the ".pnpmfile.cjs" tab should show Rush's file, not the generated temp file * Upgrade Prettier to support `async using` * prettier -w . * PR feedback: use "await using" * PR feedback * PR feedback * rush change * PR feedback * Fix build break * Revert `[Symbol.asyncDispose]()` because it isn't supported by Node 18
…lse; improve docs
Summary
Fixes concurrency bug where weighted operations could exceed the specified parallelism limit.
Details
In the current implementation with
maxConcurrency = 8andconcurrentUnitsInProgress = 4, a task withweight = 8could be queued due to no check existing to prevent queueing this new task. This change waits for enough free units before queueing the weight-8 task.This oversubscription causes test flakes and slower execution due to too many tasks running simultaneously.
Changes:
How it was tested
rush-redis-cobuild-plugin-integration-testImpacted documentation