node-mongodb-native
node-mongodb-native copied to clipboard
feat(NODE-6275): Add CSOT support to GridFS
Description
What is changing?
GridFSUploadStream
- Add CSOT support by piping
TimeoutContextdown through all operations over lifetime ofGridFSUploadStream - Migrate
checkIndexescall from constructor to asyncconstruct()method to accomodate CSOT error handling
GridFSDownloadStream
- Add CSOT support by piping
TimeoutContextdown through all operations over lifetime ofGridFSDownloadStream
GridFSBucket
- Add support for
timeoutMSoption 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()andGridFSBucket.openDownloadStreamByName()) properly handletimeoutMS - Add int test verifying that
'index'event is emitted exactly once byGridFSBucketwhen 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:lintscript - [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
- Example:
- [X] Changes are covered by tests
- [ ] New TODOs have a related JIRA ticket
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
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.