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

Unable to exit from hasNext() for tailable cursor if cursor was closed from another thread

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 3.6.0
    • Affects Version/s: 3.5.0
    • Component/s: Query Operations
    • None
    • Environment:
      WIndows 10, Java 1.8
    • Fully Compatible

      Unable to exit from hasNext() for tailable cursor if cursor was closed from another thread
      My proposal is to add another check for "closed" inside

              while (serverCursor != null) {
                  getMore();
                  if (nextBatch != null) {
                      return true;
                  }
              }
      

      before getMore(). So if cursor was closed from another thread, hasNext() will exit. But this should be done in thread-safe way.

            Assignee:
            jeff.yemin@mongodb.com Jeffrey Yemin
            Reporter:
            igorko Igor
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: