node-mongodb-native icon indicating copy to clipboard operation
node-mongodb-native copied to clipboard

feat(NODE-6275): Add CSOT support to GridFS

Open W-A-James opened this issue 1 year ago • 2 comments

Description

What is changing?

GridFSUploadStream
  • Add CSOT support by piping TimeoutContext down through all operations over lifetime of GridFSUploadStream
  • Migrate checkIndexes call from constructor to async construct() method to accomodate CSOT error handling
GridFSDownloadStream
  • Add CSOT support by piping TimeoutContext down through all operations over lifetime of GridFSDownloadStream
GridFSBucket
  • Add support for timeoutMS option to:
    • GridFSBucket.openUploadStream()
    • GridFSBucket.openUploadStreamWithId()
    • GridFSBucket.openDownloadStream()
    • GridFSBucket.openDownloadStreamByName()
    • GridFSBucket.find()
    • GridFSBucket.drop()
    • GridFSBucket.rename()
    • GridFSBucket.delete()
Testing
  • Unskip CSOT gridfs spec tests
  • Implement Prose test 6 and 7
  • Add int tests that verify that non-spec-required methods (GridFSBucket.openUploadStreamWithId() and GridFSBucket.openDownloadStreamByName()) properly handle timeoutMS
  • Add int test verifying that 'index' event is emitted exactly once by GridFSBucket when creating upload streams
Is there new documentation needed for these changes?

Yes, punt to NODE-5688, also see NODE-6275 for specifics.

What is the motivation for this change?

NODE-6275

Release Highlight

Double check the following

  • [X] Ran npm run check:lint script
  • [X] Self-review completed using the steps outlined here
  • [X] PR title follows the correct format: type(NODE-xxxx)[!]: description
    • Example: feat(NODE-1234)!: rewriting everything in coffeescript
  • [X] Changes are covered by tests
  • [ ] New TODOs have a related JIRA ticket

W-A-James avatar Sep 24 '24 21:09 W-A-James

Note, tests currently failing since mongodb-legacy does not currently pass through the options for some methods that now have an options argument, being addressed here

W-A-James avatar Sep 25 '24 21:09 W-A-James

Re the question about leaking cursors on the server, you're right, it's not a new question for CSOT, but thought it might still be good to flag it here. Not sure if there's anything we want to or can do about it rn.

W-A-James avatar Sep 30 '24 15:09 W-A-James