fix: fix worker node recreation race condition
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Mon, 1 Apr 2024 19:37:48 +0000 (21:37 +0200)
committerJérôme Benoit <jerome.benoit@piment-noir.org>
Mon, 1 Apr 2024 19:37:48 +0000 (21:37 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
CHANGELOG.md
src/pools/abstract-pool.ts

index 27e78fda01730a02caf1ed20f16a10bb7b75d04c..c4b7f9b606d95fab4b791eac6ea3d3ce0036b3e0 100644 (file)
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
 
 ## [Unreleased]
 
+### Fixed
+
+- Fix possible race condition at worker node recreation on worker `error` and `exit` events.
+
 ## [3.1.28] - 2024-04-01
 
 ### Fixed
index 0cec96ab5ac277dcb41336a89f3776806c956cc8..5c153087640dc76e09b029deaafdd72c3fa1f47b 100644 (file)
@@ -1252,7 +1252,7 @@ export abstract class AbstractPool<
         if (workerNode.info.dynamic) {
           this.createAndSetupDynamicWorkerNode()
         } else {
-          this.createAndSetupWorkerNode()
+          this.startMinimumNumberOfWorkers()
         }
       }
       if (