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

haproxy connections trigger "Can't set socket option","attr":{"optname":"TCP_KEEPALIVE","error":"Invalid argument"}}

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: In Code Review
    • Priority: Major - P3
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: 5.1 Required
    • Component/s: None
    • Labels:
      None
    • Operating System:
      ALL
    • Sprint:
      Service Arch 2021-09-06, Service Arch 2021-09-20, Service Arch 2021-10-04
    • Story Points:
      5

      Description

      5.0.0-rc0 clusters (standalone mongod, mongos) running on macOS, I see many errors like this "ctx":"listener","msg":"Can't set socket option","attr":{"optname":"TCP_KEEPALIVE","error":"Invalid argument"}}

      The log is flooded with these errors:

      {"t":{"$date":"2021-06-04T13:16:52.682-07:00"},"s":"E",  "c":"NETWORK",  "id":23206,   "ctx":"listener","msg":"Can't set socket option","attr":{"optname":"TCP_KEEPALIVE","error":"Invalid argument"}}
      {"t":{"$date":"2021-06-04T13:16:52.682-07:00"},"s":"W",  "c":"NETWORK",  "id":23023,   "ctx":"listener","msg":"Error accepting new connection","attr":{"error":{"code":9001,"codeName":"SocketException","errmsg":"remote_endpoint: Invalid argument"}}}
      {"t":{"$date":"2021-06-04T13:16:52.682-07:00"},"s":"I",  "c":"NETWORK",  "id":23018,   "ctx":"listener","msg":"Error accepting new connection on local endpoint","attr":{"localEndpoint":"127.0.0.1:27017","error":"Invalid argument"}}
      

      The connections that error are coming from an otherwise idle load balancer (haproxy). When a driver connects directly to the mongod/s the error does not occur. What does this error mean and why do these errors occur for haproxy connections?

      The load balancer is started and stopped with this run-load-balancer.sh script, like this:

      $  sudo MONGODB_URI='mongodb://localhost:27017,localhost:27018/' .evergreen/run-load-balancer.sh start
      Starting HAProxy...
      Single Mongos LB: mongodb://127.0.0.1:8000/?loadBalanced=true
      Multiple Mongos LB: mongodb://127.0.0.1:8001/?loadBalanced=true
      $ sudo MONGODB_URI='mongodb://localhost:27017,localhost:27018/' .evergreen/run-load-balancer.sh stop
      Stopping HAProxy...
      

        Attachments

          Activity

            People

            Assignee:
            blake.oler Blake Oler
            Reporter:
            shane.harvey Shane Harvey
            Participants:
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Dates

              Created:
              Updated: