-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: 3.5.9
-
Component/s: Core
-
Empty show more show less
When using ipv6 and protocol `mongodb+srv` there will be an error:
events.js:263
EventEmitter.prototype.emit = function emit(type, ...args) {
^
RangeError: Maximum call stack size exceeded
at MongoClient.emit (events.js:263:44)
at NativeTopology.<anonymous> (/data01/pyltest/mongo-nodeJS-driver/lib/operations/connect.js:716:19)
at NativeTopology.emit (events.js:315:20)
at Server.<anonymous> (/data01/pyltest/mongo-nodeJS-driver/lib/core/utils.js:23:71)
at Server.emit (events.js:315:20)
at Monitor.<anonymous> (/data01/pyltest/mongo-nodeJS-driver/lib/core/utils.js:23:71)
at Monitor.emit (events.js:315:20)
at failureHandler (/data01/pyltest/mongo-nodeJS-driver/lib/core/sdam/monitor.js:146:13)
at /data01/pyltest/mongo-nodeJS-driver/lib/core/sdam/monitor.js:186:7
at /data01/pyltest/mongo-nodeJS-driver/lib/core/connection/connect.js:31:7
at callback (/data01/pyltest/mongo-nodeJS-driver/lib/core/connection/connect.js:264:5)
at makeConnection (/data01/pyltest/mongo-nodeJS-driver/lib/core/connection/connect.js:277:12)
at connect (/data01/pyltest/mongo-nodeJS-driver/lib/core/connection/connect.js:29:3)
at checkServer (/data01/pyltest/mongo-nodeJS-driver/lib/core/sdam/monitor.js:183:3)
at /data01/pyltest/mongo-nodeJS-driver/lib/core/sdam/monitor.js:215:5
at executeAndReschedule (/data01/pyltest/mongo-nodeJS-driver/lib/utils.js:813:5)
at makeInterruptableAsyncInterval (/data01/pyltest/mongo-nodeJS-driver/lib/utils.js:820:5)
at Monitor.connect (/data01/pyltest/mongo-nodeJS-driver/lib/core/sdam/monitor.js:101:24)
at Server.connect (/data01/pyltest/mongo-nodeJS-driver/lib/core/sdam/server.js:185:20)
at createAndConnectServer (/data01/pyltest/mongo-nodeJS-driver/lib/core/sdam/topology.js:871:10)
at updateServers (/data01/pyltest/mongo-nodeJS-driver/lib/core/sdam/topology.js:900:22)
at NativeTopology.serverUpdateHandler (/data01/pyltest/mongo-nodeJS-driver/lib/core/sdam/topology.js:581:5)
I think this is a bug introduced by the code below(`lib/core/sdam/monitor.js:70`)
// TODO: refactor this to pull it directly from the pool, requires new ConnectionPool integration
const addressParts = server.description.address.split(':');
this.connectOptions = Object.freeze(
Object.assign(
,
server.s.options,
this.options,
// force BSON serialization options
{ raw: false, promoteLongs: true, promoteValues: true, promoteBuffers: true } )
);