Skip to content

Commit d217b79

Browse files
yashLadhatargos
authored andcommitted
cluster: removed unused addressType argument from constructor
When intializing the constructor for cluster master we are heavily using a generic structure, but the effect of passing arguments that are related to shared_handle is that there is a stale argument passed. We can avoid such scenarios as all the remaining entities are being destructured from the message object. PR-URL: #32963 Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Andrey Pechkurov <apechkurov@gmail.com>
1 parent 08b66f2 commit d217b79

File tree

3 files changed

+3
-8
lines changed

3 files changed

+3
-8
lines changed

lib/internal/cluster/master.js

+1-6
Original file line numberDiff line numberDiff line change
@@ -297,12 +297,7 @@ function queryServer(worker, message) {
297297
constructor = SharedHandle;
298298
}
299299

300-
handle = new constructor(key,
301-
address,
302-
message.port,
303-
message.addressType,
304-
message.fd,
305-
message.flags);
300+
handle = new constructor(key, address, message);
306301
handles.set(key, handle);
307302
}
308303

lib/internal/cluster/round_robin_handle.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const { constants } = internalBinding('tcp_wrap');
1414

1515
module.exports = RoundRobinHandle;
1616

17-
function RoundRobinHandle(key, address, port, addressType, fd, flags) {
17+
function RoundRobinHandle(key, address, { port, fd, flags }) {
1818
this.key = key;
1919
this.all = new Map();
2020
this.free = new Map();

lib/internal/cluster/shared_handle.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const net = require('net');
66

77
module.exports = SharedHandle;
88

9-
function SharedHandle(key, address, port, addressType, fd, flags) {
9+
function SharedHandle(key, address, { port, addressType, fd, flags }) {
1010
this.key = key;
1111
this.workers = new Map();
1212
this.handle = null;

0 commit comments

Comments
 (0)