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

ConnectionPoolCreatedEvent is not spec compliant as it contains the entire MongoClientOptions instance

    • 3
    • 2
    • Needed
    • v5.x, v4.x
    • Needed
    • Hide

      1. What would you like to communicate to the user about this feature?
      We are removing all fields from the ConnectionPoolCreatedEvent.options field excepting those directly related to the connection pool:

      • maxConnecting
      • maxPoolSize
      • minPoolSize
      • maxIdleTimeMS
      • waitQueueTimeoutMS

      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      No

      3. Which versions of the driver/connector does this apply to?
      >= 6.0

      Show
      1. What would you like to communicate to the user about this feature? We are removing all fields from the ConnectionPoolCreatedEvent.options field excepting those directly related to the connection pool: maxConnecting maxPoolSize minPoolSize maxIdleTimeMS waitQueueTimeoutMS 2. Would you like the user to see examples of the syntax and/or executable code and its output? No 3. Which versions of the driver/connector does this apply to? >= 6.0

      Per the CMAP Specification, when a PoolCreatedEvent is sent it should only contain any non-default pool options:

      /**
       *  Emitted when a Connection Pool is created
       */
      interface PoolCreatedEvent {
        /**
         *  The ServerAddress of the Endpoint the pool is attempting to connect to.
         */
        address: string;
      
        /**
         *  Any non-default pool options that were set on this Connection Pool.
         */
        options: {...}
      }
      

      AC

      Implementation Requirements

      • Change ConnectionPoolCreatedEvent constructor to pick the following fields from the ConnectionPoolOptions
        • maxPoolSize
        • minPoolSize
        • maxIdleTileMS
        • maxConnecting
        • waitQueueTimeoutMS
      • Check whether or not the Unified Test Runner has extra logic that allowed it pass with the additional fields present. If this is the case, remove this extra logic 

      Testing Requirements

      • Add integration test that checks that we only get the fields listed in the implementation requirements when a ConnectionPoolCreatedEvent is emitted by the client
      • Add a unit test that checks that we only pick the fields listed in the implementation requirements when a ConnectionPoolCreatedEvent is constructed.

            Assignee:
            warren.james@mongodb.com Warren James
            Reporter:
            alex.bevilacqua@mongodb.com Alex Bevilacqua
            Neal Beeken
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: