)
}
const workerInfo = this.getWorkerInfo(workerNodeKey)
+ if (workerInfo == null) {
+ throw new Error(
+ `Worker node with key '${workerNodeKey}' not found in pool`
+ )
+ }
if (
this.cannotStealTask() ||
(this.info.stealingWorkerNodes ?? 0) >
Math.floor(this.workerNodes.length / 2)
) {
- if (workerInfo != null && previousStolenTask != null) {
+ if (previousStolenTask != null) {
workerInfo.stealing = false
this.resetTaskSequentiallyStolenStatisticsWorkerUsage(
workerNodeKey,
}
const workerNodeTasksUsage = this.workerNodes[workerNodeKey].usage.tasks
if (
- workerInfo != null &&
previousStolenTask != null &&
(workerNodeTasksUsage.executing > 0 ||
this.tasksQueueSize(workerNodeKey) > 0)
)
return
}
- if (workerInfo == null) {
- throw new Error(
- `Worker node with key '${workerNodeKey}' not found in pool`
- )
- }
workerInfo.stealing = true
const stolenTask = this.workerNodeStealTask(workerNodeKey)
if (stolenTask != null) {