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

Refactor connection class to enforce the "single track" spec rule

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Unknown Unknown
    • None
    • Affects Version/s: None
    • Component/s: Connection Layer
    • None

      The CMAP spec dictates that a connection must be:

      Single Track: A `Connection`_ MUST limit itself to one request / response at a time. A `Connection`_ MUST NOT multiplex/pipeline requests to an Endpoint.

      Our current implementation has a request queue and relies on only one request ever being pushed to the queue to adhere to the above rule. We should update the connection implementation to only keep track of one request at a time and error if another request is attempted on the connection before the response to the in-flight request is received.

      AC

      • Remove the queue and replace with a property that tracks the current in-flight request (operation)
      • Error if another request (operation) is submitted to the connection before the in-flight request completes (call the new operation's callback with the appropriate error)

            Assignee:
            Unassigned Unassigned
            Reporter:
            daria.pardue@mongodb.com Daria Pardue
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: