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

Cursor All Function gives context deadline exceeded error in MongoDB Go Driver for varying limits

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Unknown Unknown
    • None
    • None
    • None
    • None

    Description

      I have a collection with 763 documents which I fetch 200 at a time using cursor based pagination. 
      I am using MongoDB Find Function and then using cursor.All to unmarshall the response into their respective data structures.
      The first 3 pages (200*3 = 600) work smoothly however on the last page I see a context deadline exceeded issue. 

      incomplete read of message header: context deadline exceeded 

      Upon further inspection it's coming from the following line of code

      cursorErr := dbCursor.All(childctx, result); 

      This happens when the limit is set as 200, however if I change it to 163 (the exact number of documents on the last page) it works perfectly. 

      I tried the exact same query on Compass and it works fine. 

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            hrishikesh@airstack.xyz Hrishikesh Thakkar
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated: