Skip to content

Commit 98a2c67

Browse files
yashLadhaBridgeAR
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 44a5b73 commit 98a2c67

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
@@ -13,7 +13,7 @@ const { constants } = internalBinding('tcp_wrap');
1313

1414
module.exports = RoundRobinHandle;
1515

16-
function RoundRobinHandle(key, address, port, addressType, fd, flags) {
16+
function RoundRobinHandle(key, address, { port, fd, flags }) {
1717
this.key = key;
1818
this.all = new Map();
1919
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)