PHPC-2660 Test that killCursors is sent after a connection error during getMore#1997
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new PHPT regression test for PHPC-2660 to ensure the driver issues a killCursors command after a connection error occurs during getMore, relying on libmongoc’s reconnect behavior.
Changes:
- Introduces a new cursor test that triggers a connection drop on
getMorevia a failpoint. - Adds command monitoring to assert that
killCursorsis sent exactly once when the cursor is destroyed after the error.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Changes LGTM, but it looks like this doesn't work on load balanced connections -- @kevinAlbs is this expected to work there? If not, I'm happy skipping the tests when connected to a load balancer. |
kevinAlbs
left a comment
There was a problem hiding this comment.
@kevinAlbs is this expected to work there? If not, I'm happy skipping the tests when connected to a load balancer.
killCursors is not expected to be sent after connection error when connected to a load balancer:
// Do not attempt to reconnect when in load balanced mode. Cursors are pinned to connections in load balanced mode. A
// new connection might not connect to the same backing server.
const bool reconnect_ok = _mongoc_topology_get_type(client->topology) != MONGOC_TOPOLOGY_LOAD_BALANCED;So I agree with skipping the test when connected to a load balancer.
|
The new test is now skipped for load-balancer. |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Add a test verifying that
killCursorsis sent by the driver after a connection error duringgetMore, using the reconnect behavior introduced in libmongoc 2.3.0.Fix PHPC-2660