Uploaded image for project: 'Ruby Driver'
  1. Ruby Driver
  2. RUBY-3332

Tailable cursors not working in driver version 2.16.3

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Critical - P2 Critical - P2
    • 2.18.3, 2.19.2, 2.17.4, 2.16.4
    • Affects Version/s: None
    • Component/s: None
    • None

      I encountered an issue where tailable cursors don't work properly in ruby driver version 2.16.3. When consuming the cursor, it exits after all documents are read rather than awaiting for further ones.

       

      From what I saw in the driver code, after the cursor is created it's already treated as closed, because it has id 0. This issue doesn't occur on version 2.15.1 or earlier.

       

      Environment details:

      • mongo 3.2
      • ruby 3.2.2

       

      Reproduction steps:

      1. Create a capped collection `capped` in `test` db
      2. Ensure there's at least one document in it
      3. Prepare a `Gemfile with appropriate `mongo` gem version
      4. Run `bundle exec ruby consumer.rb` in background (producer.rb attached)
      5. Run `bundle exec ruby producer.rb`

      For version 2.15.1: `bundle exec ruby consumer.rb` prints all the documents and then, whenever `bundle exec ruby producer.rb` is run, it prints the newly added document

      For version 2.16.3: `bundle exec ruby consumer.rb` prints all the documents and then exits

        1. producer.rb
          0.1 kB
        2. consumer.rb
          0.2 kB

            Assignee:
            dmitry.rybakov@mongodb.com Dmitry Rybakov
            Reporter:
            mchwalek89@gmail.com Maksymilian Chwałek
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: