repositories
/
poolifier.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix: fix race condition in worker choice strategies
[poolifier.git]
/
src
/
pools
/
selection-strategies
/
least-used-worker-choice-strategy.ts
diff --git
a/src/pools/selection-strategies/least-used-worker-choice-strategy.ts
b/src/pools/selection-strategies/least-used-worker-choice-strategy.ts
index 4387d792ef951c2e602308b48d4caffd95e67d53..c750c290d1d7f3c5039698a9be04a2971b623781 100644
(file)
--- a/
src/pools/selection-strategies/least-used-worker-choice-strategy.ts
+++ b/
src/pools/selection-strategies/least-used-worker-choice-strategy.ts
@@
-60,13
+60,10
@@
export class LeastUsedWorkerChoiceStrategy<
workerTaskStatistics.executed +
workerTaskStatistics.executing +
workerTaskStatistics.queued
workerTaskStatistics.executed +
workerTaskStatistics.executing +
workerTaskStatistics.queued
- if (
this.isWorkerNodeEligible(workerNodeKey) &&
workerTasks === 0) {
+ if (workerTasks === 0) {
chosenWorkerNodeKey = workerNodeKey
break
chosenWorkerNodeKey = workerNodeKey
break
- } else if (
- this.isWorkerNodeEligible(workerNodeKey) &&
- workerTasks < minNumberOfTasks
- ) {
+ } else if (workerTasks < minNumberOfTasks) {
minNumberOfTasks = workerTasks
chosenWorkerNodeKey = workerNodeKey
}
minNumberOfTasks = workerTasks
chosenWorkerNodeKey = workerNodeKey
}