Skip to content

Conversation

@comandeo-mongo
Copy link
Contributor

No description provided.

@comandeo-mongo comandeo-mongo requested a review from a team as a code owner July 18, 2025 12:21
@comandeo-mongo comandeo-mongo requested a review from jamis July 18, 2025 12:21
jamis
jamis previously approved these changes Jul 18, 2025
Copilot AI review requested due to automatic review settings November 17, 2025 06:45
Copilot finished reviewing on behalf of comandeo-mongo November 17, 2025 06:47
Copy link

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 PR fixes CSOT (Client-Side Operation Timeout) handling in the with_transaction method by properly supporting zero/infinite timeouts and refactoring deadline calculation logic.

Key Changes:

  • Refactored deadline calculation into a separate calculate_with_transaction_deadline method that handles timeout_ms: 0 as infinite timeout
  • Added deadline_expired? helper method to properly check deadline expiration, treating 0 as never expired
  • Added comprehensive test coverage for CSOT scenarios including zero timeout, positive timeout, and disabled CSOT

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.

File Description
spec/mongo/session_transaction_spec.rb Adds test coverage for CSOT with with_transaction, including tests for zero timeout (infinite), positive timeout values, and disabled CSOT scenarios
lib/mongo/session.rb Refactors with_transaction to extract deadline calculation logic and properly handle infinite timeouts (when timeout_ms: 0), plus adds helper method for deadline expiration checks

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

2 participants