Uploaded image for project: 'C Driver'
  1. C Driver
  2. CDRIVER-798

Async scan spins for 30 seconds after server hangup

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 1.2-beta1
    • Affects Version/s: 1.2-beta0
    • Component/s: None
    • None

      Even with serverSelectionTryOnce true, if the server hangs up on an "ismaster" call, mongoc_async_run spins serverSelectionTimeoutMS (default 30 seconds) before giving up and returning to mongoc_topology_select.

      When mongoc_stream_read returns 0 it means the server has shut down the connection, but the 0 return is not properly handled so the async_cmd_t remains in the "receiving" phase. The socket appears readable so mongoc_async_run doesn't block on "poll", hence the 100% CPU spin until the timeout.

            Assignee:
            jesse@mongodb.com A. Jesse Jiryu Davis
            Reporter:
            jesse@mongodb.com A. Jesse Jiryu Davis
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: