Uploaded image for project: 'Node.js Driver'
  1. Node.js Driver
  2. NODE-2671

ipv6 is not supported when using dns service discovering

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 3.5.10
    • Affects Version/s: 3.5.9
    • Component/s: Core

      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(

      { id: '<monitor>', host: addressParts[0], port: parseInt(addressParts[1], 10), bson: server.s.bson, connectionType: Connection }

      ,
      server.s.options,
      this.options,

      // force BSON serialization options

      { raw: false, promoteLongs: true, promoteValues: true, promoteBuffers: true }

      )
      );

       

            Assignee:
            neal.beeken@mongodb.com Neal Beeken
            Reporter:
            peiyulin.se@gmail.com Lim Pei
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: