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

RTTPinger always sends legacy hello even when serverApi is enabled

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.17.2, 5.9.2, 6.3.0
    • Affects Version/s: 4.17.1, 5.9.1, 6.2.0
    • Component/s: SDAM
    • 2
    • Not Needed
    • Hide

      Create a copy of the Kickoff Template with the issue key (NODE-XXX) in the filename and share a link to the new doc via this field.

      Show
      Create a copy of the Kickoff Template with the issue key (NODE-XXX) in the filename and share a link to the new doc via this field.
    • Not Needed
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?

      What problem are you facing?

      The RTTPinger's hello command is always constructed with the legacy hello:

      connection.command(ns('admin.$cmd'), { [LEGACY_HELLO_COMMAND]: 1 }...
      

      When serverApi is enabled this causes an error to be sent to the driver:

      MongoServerError: Provided apiStrict:true, but the command isMaster is not in API Version 1. Information on supported commands and migrations in API Version 1 can be found at https://dochub.mongodb.org/core/manual-versioned-api
      

      This error is leading to leaked connections, it can be observed that after MongoClient.close the node process does not exit.

      What driver and relevant dependency versions are you using?

      Observed the resulting bug in 5.x and 6.x. 4.x also has legacy hello hardcoded.

      Steps to reproduce?

      See attached.

      Dependencies

      • The specifications - is there language about the RTTPinger in versioned-api using hello vs ismaster? Is there a way to spec or prose test this for all drivers?

      Unknowns

      • None

      Acceptance Criteria

      Implementation Requirements

      • The rttPinger should respect serverApi and helloOk to determine whether hello or isMaster should be sent.
      • The error handling for the rttPinger's hello only sets the rttPinger's connection to null, it should also destroy it.

      Testing Requirements

      • After creating a MongoClient with serverApi enabled spy on the rttPinger's connection and assert hello is sent to the server
      • Using sinon, force a hello to "throw" (define an error in callback) and assert the connection was destroyed.

      Documentation Requirements

      • None

      Follow Up Requirements

      • Depending on the language spec, consider a drivers ticket if this behavior needs clarification.

        There are no Sub-Tasks for this issue.

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

              Created:
              Updated:
              Resolved: