Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-9908

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

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

      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 Unassigned
            Reporter:
            greg_10gen Greg Studer
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: