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
- split to
-
CDRIVER-4804 SDAM heartbeats timeout spec test expects closure of connections before they attempt an operation
- Backlog
-
CSHARP-4898 SDAM heartbeats timeout spec test expects closure of connections before they attempt an operation
- Backlog
-
CXX-2806 SDAM heartbeats timeout spec test expects closure of connections before they attempt an operation
- Backlog
-
JAVA-5282 SDAM heartbeats timeout spec test expects closure of connections before they attempt an operation
- Backlog
-
GODRIVER-3084 SDAM heartbeats timeout spec test expects closure of connections before they attempt an operation
- Closed
-
MOTOR-1229 SDAM heartbeats timeout spec test expects closure of connections before they attempt an operation
- Closed
-
NODE-5807 SDAM heartbeats timeout spec test expects closure of connections before they attempt an operation
- Closed
-
PHPLIB-1329 SDAM heartbeats timeout spec test expects closure of connections before they attempt an operation
- Closed
-
PYTHON-4116 SDAM heartbeats timeout spec test expects closure of connections before they attempt an operation
- Closed
-
RUBY-3365 SDAM heartbeats timeout spec test expects closure of connections before they attempt an operation
- Closed
-
RUST-1817 SDAM heartbeats timeout spec test expects closure of connections before they attempt an operation
- Closed
- links to