Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-2965

maxAwaitTime not working on a change stream

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Done
    • Affects Version/s: 3.8.0
    • Fix Version/s: None
    • Component/s: Query Operations
    • Labels:
      None

      Description

      I'm using the java driver version 3.8.0 and mongodb 3.6.

      The documentation here states about maxAwaitTime:

      The maximum amount of time for the server to wait on new documents to satisfy a change stream query.

      However, what I'm seeing is that cursor.hasNext() returns only if there is a change on the collection, never when the time passed to maxAwaitTime has elapsed.

      When I turn on mongodb's verbose logging I see maxWaitTime set as expected in the getMore command.

      Is maxAwaitTime supposed to cause my watch to timeout when there are no changes?

        Attachments

          Activity

            People

            Assignee:
            jeff.yemin Jeffrey Yemin
            Reporter:
            crummel Chris
            Participants:
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: