Uploaded image for project: 'Go Driver'
  1. Go Driver
  2. GODRIVER-2959

Mongodb watch change stream will panic, when no data be found by query condition

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Works as Designed
    • Icon: Major - P3 Major - P3
    • None
    • 1.12.1
    • None
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?

    Description

      Summary

      mongodb go driver version from 1.11.1 to 1.12.1, watch changestream will be panic.

      go.mongodb.org/mongo-driver/mongo.(*ChangeStream).loopNext(0xc000002140, {0x124ca00, 0x18e8040}, 0x0)
      	/go/pkg/mod/go.mongodb.org/mongo-driver@v1.12.1/mongo/change_stream.go:658 +0x6b
      go.mongodb.org/mongo-driver/mongo.(*ChangeStream).next(0xc000002140, {0x124ca00?, 0x18e8040?}, 0xd0?)
      	/go/pkg/mod/go.mongodb.org/mongo-driver@v1.12.1/mongo/change_stream.go:627 +0x5d
      go.mongodb.org/mongo-driver/mongo.(*ChangeStream).Next(...)
      	/go/pkg/mod/go.mongodb.org/mongo-driver@v1.12.1/mongo/change_stream.go:598
      draw-platform/storage/mongodb.(*StorageCollection).WatchRunnerResponse.func1()
      

      How to Reproduce

      Create a empty collection and set the Watch mongo.Pipeline{matchStage} like this:

       
      matchStage := bson.D{{
      Key: "$match", Value: bson.D{

      {Key: "fullDocument.env", Value: store.env}

      ,

      {Key: "fullDocument.requestUUID", Value: requestUUID}

      ,
      }},
      }
       
      and the query condition no datas will be found, because of I want to watch data from first data by the query condition.

       

      Attachments

        Activity

          People

            preston.vasquez@mongodb.com Preston Vasquez
            myselfxukai@163.com xkey N/A
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: