Uploaded image for project: 'Node.js Driver'
  1. Node.js Driver
  2. NODE-3122

Pipelining an upload stream of GridFSBucket never finishes on Node v14

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.0.0, 3.6.6
    • Affects Version/s: 3.6.4
    • Component/s: None
    • Labels:

      Pipelining an upload stream you've created with GridFSBucket.
      openUploadStream worked on Node v12.20.1 and v10.23.0, but it never finishes on Node v14.16.0.
       

      async function test() {
          const mongoClient = await mongodb.MongoClient.connect('mongodb://localhost', {
              useUnifiedTopology: true
          });
          const mongoDb = mongoClient.db('test');
          const bucket = new mongodb.GridFSBucket(mongoDb, {
              bucketName: 'testBucket'
          });
      
          const fileStream = fs.createReadStream('test.js');
          const uploadStream = bucket.openUploadStream('test');
          await util.promisify(stream.pipeline)(fileStream, uploadStream);
      }
      

      You can find the whole test at https://github.com/snakamura/mongodb-fsbucket-pipeline.

            Assignee:
            durran.jordan@mongodb.com Durran Jordan
            Reporter:
            snakamura@asteria.com Satoshi Nakamura
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: