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

Mongo client blocked on ppoll INDEFINITELY

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.4.0
    • Affects Version/s: 2.2.5
    • Component/s: None
    • None

      Ok I got another funny bug on my personal project (updown.io) using Mongoid 5.1.3 and mongo 2.2.5. This is again an issue with error handling and bad network conditions. It happened a few times in the last months but unfortunately I don't have any way to reproduce the issue yet.

      Though I know exactly why this is happening: basically sometimes because of a lost packet or whatever, the mongo client block indefinitely on this call:

      ppoll([{fd=54, events=POLLIN}], 1, NULL, NULL, 8
      

      Which is obviously broken because there is no timeout, so the client simply block the whole program indefinitely, waiting for something to read that will never come.

      I confirm the fd 54 is a mongo socket, connected to a remote host:

      54 IPv4     alpha:58294->gra.updn.io:27017
      

      I couldn't get a backtrace of where this is happening but I guess (hope) that there shouldn't be that many calls to ppoll without timeouts in your code.

      The good behavior here would be to timeout this ppoll and raise an exception of course.

      And If i'm the first one to report this bug it's probably because on local network this almost never happens, but I'm doing a lot of remote calls, which means bad network conditions.

            Assignee:
            emily.stolfo Emily Stolfo
            Reporter:
            bigbourin@gmail.com Adrien Jarthon
            Votes:
            2 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: