Uploaded image for project: 'C Driver'
  1. C Driver
  2. CDRIVER-1079

Close socket after timeout from tailable cursor

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Blocker - P1 Blocker - P1
    • 1.3.2
    • Affects Version/s: 1.3.0
    • Component/s: libmongoc
    • None

      With MongoDB 3.2+, set a short sockettimeoutms like 100ms and begin a tailable query with awaitData. After mongoc_cursor_next times out, do any subsequent operation.

      Expected: the socket has been closed, so the next operation opens a new socket and proceeds normally.

      Actual: the socket used for the query is still open, so it reads the query response instead of the current operation's response. The response will be like:

      { "cursor" : { "nextBatch" : [  ], "id" : 27258456539, "ns" : "dbtest.test_capped" }, "ok" : 1 }
      

      The bug is in the "getMore" command path with MongoDB 3.2+ (wire protocol version 4+), but not in the legacy OP_GETMORE path.

            Assignee:
            jesse@mongodb.com A. Jesse Jiryu Davis
            Reporter:
            jesse@mongodb.com A. Jesse Jiryu Davis
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: