Skip to content

Commit

Permalink
fix #318: debug ports not being released when terminating a pool
Browse files Browse the repository at this point in the history
  • Loading branch information
josdejong committed Nov 7, 2022
1 parent bc22074 commit 5d4309d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
https://github.com/josdejong/workerpool


## 2022-11-07, version 6.3.1

- Fix #318: debug ports not being released when terminating a pool.


## 2022-10-24, version 6.3.0

- Implement option `workerThreadOpts` to pass options to a worker of type
Expand Down
3 changes: 2 additions & 1 deletion src/Pool.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function Pool(script, options) {

this.forkArgs = Object.freeze(options.forkArgs || []);
this.forkOpts = Object.freeze(options.forkOpts || {});
this.workerThreadOpts = Object.freeze(options.workerThreadOpts || {})
this.workerThreadOpts = Object.freeze(options.workerThreadOpts || {})
this.debugPortStart = (options.debugPortStart || 43210);
this.nodeWorker = options.nodeWorker;
this.workerType = options.workerType || options.nodeWorker || 'auto'
Expand Down Expand Up @@ -326,6 +326,7 @@ Pool.prototype.terminate = function (force, timeout) {
this.tasks.length = 0;

var f = function (worker) {
DEBUG_PORT_ALLOCATOR.releasePort(worker.debugPort);
this._removeWorkerFromList(worker);
};
var removeWorker = f.bind(this);
Expand Down

0 comments on commit 5d4309d

Please sign in to comment.