On Linux, Socket::connect() timeout doesn't interrupt ConnectBG job

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Duplicate
    • Priority: Major - P3
    • None
    • Affects Version/s: 2.2.4, 2.4.4
    • Component/s: Networking
    • None
    • Environment:
      Linux
    • Linux
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Socket::connect() spawns a ConnectBG job that it interrupts after a 5-second timeout. However, the job doesn't get interrupted on Linux (and SO_RCVTIMEO/SO_SNDTIMEO don't have an effect on connect timeouts in Linux). Thus, the system default is used as the effective connect timeout (as a function of net.ipv4.tcp_syn_retries).

      This affects all intra-cluster connections made by mongod/mongos (and shell/tools) in failure modes where SYN packets destined to the remote server are silently dropped.

      Reproduce with:

      $ sudo iptables -A INPUT -i lo -p tcp --dport 27017 -j DROP
      $ mongod --fork --logpath log
      $ mongo
      

              Assignee:
              Unassigned
              Reporter:
              Greg Studer (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

                Created:
                Updated:
                Resolved: