[DRIVERS-2774] SDAM heartbeats timeout spec test expects closure of connections before they attempt an operation Created: 13/Nov/23 Updated: 03/Jan/24 |
|
| Status: | Implementing |
| Project: | Drivers |
| Component/s: | CMAP |
| Fix Version/s: | None |
| Type: | Spec Change | Priority: | Major - P3 |
| Reporter: | Noah Stapp | Assignee: | Valentin Kavalenka |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
| Driver Changes: | Needed | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| Quarter: | FY23Q4 | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| Downstream Changes Summary: | Remove pool-clear-interrupt-immediately.json/yml as per https://github.com/mongodb/specifications/pull/1487. |
||||||||||||||||||||||||||||||||||||||||||||||||||||
| Start date: | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| Driver Compliance: |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
| Description |
|
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:
or this:
|
| Comments |
| Comment by Githook User [ 03/Jan/24 ] |
|
Author: {'name': 'Valentin Kovalenko', 'email': 'valentin.kovalenko@mongodb.com', 'username': 'stIncMale'}Message: DRIVERS-2774 Delete `pool-clear-interrupt-immediately` (#1487) SDAM already have tests covering the functionality, for example |
| Comment by Shane Harvey [ 05/Dec/23 ] |
|
In Python there is no race. The connection will be closed and returned to the pool as soon as the driver attempts to send the next command. It's not possible to do it any other way in Python as reading/writing to the socket is the only interrupt point. |