Uploaded image for project: 'Drivers'
  1. Drivers
  2. DRIVERS-2774

SDAM heartbeats timeout spec test expects closure of connections before they attempt an operation

    • Type: Icon: Spec Change Spec Change
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Component/s: CMAP
    • None
    • $i18n.getText("admin.common.words.hide")
      Key Status/Resolution FixVersion
      CDRIVER-4804 Backlog
      CXX-2806 Backlog
      CSHARP-4898 Backlog
      GODRIVER-3084 Fixed 1.14.0
      JAVA-5282 Backlog
      NODE-5807 Done
      MOTOR-1229 Duplicate
      PYTHON-4116 Duplicate
      PHPLIB-1329 Works as Designed
      RUBY-3365 Fixed 2.20.0
      RUST-1817 Works as Designed
      $i18n.getText("admin.common.words.show")
      #scriptField, #scriptField *{ border: 1px solid black; } #scriptField{ border-collapse: collapse; } #scriptField td { text-align: center; /* Center-align text in table cells */ } #scriptField td.key { text-align: left; /* Left-align text in the Key column */ } #scriptField a { text-decoration: none; /* Remove underlines from links */ border: none; /* Remove border from links */ } /* Add green background color to cells with FixVersion */ #scriptField td.hasFixVersion { background-color: #00FF00; /* Green color code */ } /* Center-align the first row headers */ #scriptField th { text-align: center; } Key Status/Resolution FixVersion CDRIVER-4804 Backlog CXX-2806 Backlog CSHARP-4898 Backlog GODRIVER-3084 Fixed 1.14.0 JAVA-5282 Backlog NODE-5807 Done MOTOR-1229 Duplicate PYTHON-4116 Duplicate PHPLIB-1329 Works as Designed RUBY-3365 Fixed 2.20.0 RUST-1817 Works as Designed

      shane.harvey@mongodb.com and I discovered an unexpected behavior of the spec test Connections MUST be interrupted as soon as possible. As currently written, the test checks out two connections and then clears the connection pool with the interrupt flag set. According to the spec, this should interrupt any operations the active connections are performing as soon as possible. However, the two connections are checked out but idle at the time of interruption, so the test does not interrupt any operations. As a result, they aren't checked in or closed: Python doesn't allow the pool-managing thread to forcibly signal the threads that own the connections. If either connection attempted to perform an operation after the pool clear, they would be correctly checked in and closed. This behavior fails the test, but does it actually differ from the expected behavior laid out in the spec?

      Changing this test to attempt an operation after clearing the pool with the interrupt flag set could look something like this:

      operations:
        - name: ready
        - name: start
          target: thread1
        - name: start
          target: thread2
        - name: checkOutAndRunCommand  # <------ new operation
          thread: thread1
        - name: checkOutAndRunCommand  # <------ new operation
          thread: thread2
        - name: clear
          interruptInUseConnections: true
        - name: waitForEvent
          event: ConnectionPoolCleared
          count: 1
          timeout: 1000
        - name: waitForEvent
          event: ConnectionClosed
          count: 2
          timeout: 1000
        - name: close 

        or this:

      operations:
        - name: ready
        - name: checkOut
          label: conn1
        - name: checkOut
          label: conn2
        - name: clear
          interruptInUseConnections: true
        - name: waitForEvent
          event: ConnectionPoolCleared
          count: 1
          timeout: 1000
        - name: runCommand # <------ new operation
          label: conn1
          result: error
        - name: runCommand # <------ new operation
          label: conn2
          result: error
        - name: checkIn
          connection: conn1
        - name: checkIn
          connection: conn2
        - name: waitForEvent
          event: ConnectionClosed
          count: 2
          timeout: 1000
        - name: close 

       

       

       

            Assignee:
            valentin.kovalenko@mongodb.com Valentin Kavalenka
            Reporter:
            noah.stapp@mongodb.com Noah Stapp
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: