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

ChangeStreamBatchCursor is not interruptable

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major - P3 Major - P3
    • 3.11.0
    • None
    • Query Operations
    • None

    Description

      ChangeStreamBatchCursor is currently swallowing MongoInterruptedException as a retryable error, making threads which are blocked watching a change stream uninterruptible.

       

      Minimal reproduction which hangs forever:

       

      final Thread t =
          new Thread(
              () -> {
                try {
                  for (final ChangeStreamDocument<Document> doc : collection.watch()) {
                    System.out.println(doc);
                  }
                } catch (final MongoInterruptedException e) {
                 System.out.println("interrupted");
                }
              });
       
      t.start();
       
      Thread.sleep(1000);
       
      t.interrupt();
      t.join();

       

      Attachments

        Activity

          People

            john.stewart@mongodb.com John Stewart (Inactive)
            kevin.rosendahl@mongodb.com Kevin Rosendahl
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: