Skip to content

Conversation

@vbabanin
Copy link
Member

@vbabanin vbabanin commented Dec 29, 2023

Description:

This PR updates the GridFS API to align with MongoDB's specifications on timeoutMS. Key changes include:

  • GridFS buckets now inherit timeoutMS from their parent MongoDatabase instance.
  • All GridFS Bucket API methods support the timeoutMS option with "withTimeout" method option.
  • For methods creating streams (e.g., open_upload_stream), timeoutMS caps the entire stream's lifetime, including operations during stream construction, reads/writes, and close/abort calls.
  • Methods interacting with user-provided streams (e.g., upload_from_stream) use timeoutMS for the entire operation's timeout.
  • Documentation updated to reflect potential timeout breaches for user-provided streams lacking timeout support.
  • All cursors created for GridFS API operations now set the timeoutMode option to CURSOR_LIFETIME.

For detailed spec, see: MongoDB Specification - GridFS API.

Performance tests for the recent changes compared with the mainline: Performance Test Results.
The results indicate that there are no significant deviations.

JAVA-5277

JAVA-5277
# Conflicts:
#	driver-core/src/test/functional/com/mongodb/internal/connection/TestCommandListener.java
#	driver-sync/src/test/functional/com/mongodb/client/AbstractClientSideOperationsTimeoutProseTest.java
#	driver-sync/src/test/functional/com/mongodb/client/ClientSideOperationTimeoutProseTest.java
Copy link
Member

@rozza rozza left a comment

Choose a reason for hiding this comment

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

Looking good a couple of nits and questions

# Conflicts:
#	driver-sync/src/test/functional/com/mongodb/client/AbstractClientSideOperationsTimeoutProseTest.java
Add tests.

JAVA-5277
JAVA-5277
@vbabanin vbabanin requested a review from rozza January 9, 2024 09:07
Copy link
Member

@rozza rozza left a comment

Choose a reason for hiding this comment

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

Only a couple of minor nits - its looking good 👍

# Conflicts:
#	driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/gridfs/GridFSFindPublisher.java
#	driver-scala/src/main/scala/org/mongodb/scala/gridfs/GridFSFindObservable.scala
#	driver-sync/src/main/com/mongodb/client/gridfs/GridFSFindIterable.java
#	driver-sync/src/test/functional/com/mongodb/client/unified/UnifiedCrudHelper.java
@vbabanin
Copy link
Member Author

vbabanin commented Jan 13, 2024

Note: All comments marked with a thumbs-up 👍 have been addressed as well. Thanks!

@vbabanin vbabanin requested a review from rozza January 13, 2024 02:16
JAVA-5277
@rozza
Copy link
Member

rozza commented Jan 15, 2024

Any idea whats happening on the test tasks that are timing out?

@vbabanin vbabanin self-assigned this Jan 16, 2024
@vbabanin
Copy link
Member Author

Any idea whats happening on the test tasks that are timing out?

it looks like changing from MongoExecutionTimeout to MongoOperationTimeoutException is causing testBlockingIterationMethodsChangeStream to run into an infinite loop due to isResumableError returning always true within this while loop: ChangeStreamBatchCursor.java#L187.

I'm thinking we should tackle this by implementing the ChangeStream part of the spec, as outlined in JAVA-4054. In the meantime, what do you think about temporarily disabling this test with a TODO? Let me know your thoughts

@rozza
Copy link
Member

rozza commented Jan 16, 2024

Thats my bad - will fix in CSOT.

@rozza
Copy link
Member

rozza commented Jan 16, 2024

Fixed the changestream retryable error check in CSOT and merged - waiting for tests to run.

Copy link
Member

@rozza rozza left a comment

Choose a reason for hiding this comment

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

LGTM

@vbabanin
Copy link
Member Author

vbabanin commented Jan 17, 2024

Fixed the changestream retryable error check in CSOT and merged - waiting for tests to run.

@rozza Tests passed – great fix! Thanks for your quick action!

@vbabanin vbabanin merged commit 17b05ad into mongodb:CSOT Jan 17, 2024
@vbabanin vbabanin deleted the JAVA-5277 branch January 17, 2024 20:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants