Skip to content

Commit d8b955a

Browse files
authored
Merge pull request #4684 from aramissennyeydd/sennyeya/weighting-bug-fix
bug(rush-lib,operation-weighting): UNASSIGNED_OPERATION causing memory leak
2 parents 94790ae + 3ce2ef7 commit d8b955a

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@microsoft/rush",
5+
"comment": "Fixes a bug where cobuilds would cause a GC error when waiting for long periods of time.",
6+
"type": "none"
7+
}
8+
],
9+
"packageName": "@microsoft/rush"
10+
}

libraries/rush-lib/src/logic/operations/AsyncOperationQueue.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export const UNASSIGNED_OPERATION: 'UNASSIGNED_OPERATION' = 'UNASSIGNED_OPERATIO
1717

1818
export type IOperationIteratorResult =
1919
| OperationExecutionRecord
20-
| { weight: 0; status: typeof UNASSIGNED_OPERATION };
20+
| { weight: 1; status: typeof UNASSIGNED_OPERATION };
2121

2222
/**
2323
* Implementation of the async iteration protocol for a collection of IOperation objects.
@@ -166,7 +166,7 @@ export class AsyncOperationQueue
166166
// remote executing operation which is not ready to process.
167167
if (queue.some((operation) => operation.status === OperationStatus.RemoteExecuting)) {
168168
waitingIterators.shift()!({
169-
value: { weight: 0, status: UNASSIGNED_OPERATION },
169+
value: { weight: 1, status: UNASSIGNED_OPERATION },
170170
done: false
171171
});
172172
}

0 commit comments

Comments
 (0)