cluster: fix port reuse between cluster · nodejs/node@588b00f · GitHub
Skip to content

Commit 588b00f

Browse files
islandryuaduh95
authored andcommitted
cluster: fix port reuse between cluster
Fixes: #60086 PR-URL: #60141 Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
1 parent a87f7a5 commit 588b00f

4 files changed

Lines changed: 118 additions & 8 deletions

File tree

lib/internal/cluster/primary.js

Lines changed: 17 additions & 8 deletions

lib/internal/cluster/round_robin_handle.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,3 +137,7 @@ RoundRobinHandle.prototype.handoff = function(worker) {
137137
this.handoff(worker);
138138
});
139139
};
140+
141+
RoundRobinHandle.prototype.has = function(worker) {
142+
return this.all.has(worker.id);
143+
};

lib/internal/cluster/shared_handle.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,7 @@ SharedHandle.prototype.remove = function(worker) {
4747
this.handle = null;
4848
return true;
4949
};
50+
51+
SharedHandle.prototype.has = function(worker) {
52+
return this.workers.has(worker.id);
53+
};
Lines changed: 93 additions & 0 deletions

0 commit comments

Comments
 (0)