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

Abort ongoing operations and clean-up active resources upon client.close

    • Type: Icon: Task Task
    • Resolution: Unresolved
    • Priority: Icon: Unknown Unknown
    • None
    • Affects Version/s: None
    • Component/s: None
    • 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?

      Use Case

      As a... node driver user
      I want... ongoing operations aborted on client.close()
      So that... pending resources are cleaned up

      Acceptance Criteria

      • Add an AbortController on the client
      • When the signal aborts, any ongoing operations on the client should reject
        • For each ongoing socket operation, timer, and file read, pass in abort controller that interrupts the promise completion and make the promise reject
        • For file accesses. use the abortable helper so that the wrapped promise rejects
        • Call the abort signal on client close
      • Ensure all calls to socket.destroy() finish before returning client.close()

      Testing Criteria

      • Unit test that upon signal abort:
        • Socket, timer, and file read promises are interrupted and reject 
        • File access promises complete then reject 

            Assignee:
            Unassigned Unassigned
            Reporter:
            aditi.khare@mongodb.com Aditi Khare
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: