Skip to content

PHPC-2660 Test that killCursors is sent after a connection error during getMore#1997

Merged
GromNaN merged 3 commits into
mongodb:v2.xfrom
GromNaN:PHPC-2660
Apr 28, 2026
Merged

PHPC-2660 Test that killCursors is sent after a connection error during getMore#1997
GromNaN merged 3 commits into
mongodb:v2.xfrom
GromNaN:PHPC-2660

Conversation

@GromNaN

@GromNaN GromNaN commented Apr 21, 2026

Copy link
Copy Markdown
Member

Add a test verifying that killCursors is sent by the driver after a connection error during getMore, using the reconnect behavior introduced in libmongoc 2.3.0.

Fix PHPC-2660

Copilot AI review requested due to automatic review settings April 21, 2026 14:16
@GromNaN GromNaN requested a review from a team as a code owner April 21, 2026 14:16
@GromNaN GromNaN requested review from paulinevos and removed request for a team April 21, 2026 14:16

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 getMore via a failpoint.
  • Adds command monitoring to assert that killCursors is 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.

Comment thread tests/cursor/cursor-getmore-007.phpt
@alcaeus

alcaeus commented Apr 27, 2026

Copy link
Copy Markdown
Member

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 kevinAlbs self-requested a review April 27, 2026 13:58

@kevinAlbs kevinAlbs left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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.

@GromNaN

GromNaN commented Apr 27, 2026

Copy link
Copy Markdown
Member Author

The new test is now skipped for load-balancer.

@GromNaN GromNaN enabled auto-merge (squash) April 27, 2026 18:26
Copilot AI review requested due to automatic review settings April 27, 2026 18:28

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@GromNaN GromNaN merged commit aa8cdcc into mongodb:v2.x Apr 28, 2026
47 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants