Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(POC V2) GODRIVER-3173 Complete pending reads on conn checkout #1977

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

prestonvasquez
Copy link
Collaborator

Summary

Background & Motivation

@mongodb-drivers-pr-bot mongodb-drivers-pr-bot bot added the priority-3-low Low Priority PR for Review label Mar 5, 2025
Copy link
Contributor

API Change Report

./v2/event

compatible changes

ConnectionPendingReadFailed: added
ConnectionPendingReadStarted: added
ConnectionPendingReadSucceeded: added
PoolEvent.RemainingTime: added
PoolEvent.RequestID: added

./v2/x/mongo/driver/topology

incompatible changes

BGReadCallback: removed
BGReadTimeout: removed

compatible changes

PendingReadTimeout: added

@prestonvasquez prestonvasquez changed the title (POC V2) DRIVERS-2868 Complete pending reads on conn checkout (POC V2) GODRIVER-3173 Complete pending reads on conn checkout Mar 5, 2025
@prestonvasquez prestonvasquez requested a review from Copilot March 19, 2025 17:45
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request implements changes to support completing pending reads on connection checkout. Key changes include:

  • Adding new YAML tests for client‐side operation timeouts related to pending reads.
  • Updating connection and pool logic to handle pending reads with context values (e.g. maxTimeMS and requestID) and synchronizing background reads.
  • Introducing new monitoring events and updating event verification and test instrumentation to track pending read events.

Reviewed Changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
testdata/client-side-operations-timeout/pending-reads.yml New YAML tests for handling operation timeouts and pending read scenarios.
internal/integration/client_test.go Updated concurrent operation tests to account for pending reads.
internal/driverutil/context.go Added context helper functions for maxTimeMS and requestID propagation.
x/mongo/driver/topology/pool.go Updated pool checkout logic to await completion of pending reads and renamed timeout constants.
x/mongo/driver/topology/pool_test.go Revised pool tests to verify new pending read behaviors.
internal/integration/unified/event_verification.go Added fields and tests for verifying new pending read pool events.
event/monitoring.go Extended pool event monitoring with pending read event support.
x/mongo/driver/operation.go Propagated context values in operation execution for pending read handling.
internal/integration/csot_test.go Updated CSOT tests to ensure connection closure conditions with pending reads.
Comments suppressed due to low confidence (2)

internal/integration/unified/event_verification.go:61

  • Field name 'ConnectionPendingreadSucceeded' should be 'ConnectionPendingReadSucceeded' to maintain consistent capitalization with the other pending read event fields.
ConnectionPendingreadSucceeded *struct{} `bson:"connectionPendingReadSucceeded"`

x/mongo/driver/topology/pool.go:908

  • Typo in comment: 'alawys' should be corrected to 'always'. Consider removing or clarifying this inline question to avoid confusion.
if size == 0 { // Question: Would this alawys equal to zero?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority-3-low Low Priority PR for Review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant