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

Fix TCP keepalive option setting

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 7.0.0-rc0, 5.0.24
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Fully Compatible
    • v6.0, v5.0, v4.4
    • Service Arch 2022-12-26, Service Arch 2022-09-05, Service Arch 2022-09-19, Service Arch 2022-10-03, Service Arch 2022-10-17, Service Arch 2022-10-31, Service Arch 2022-11-14, Service Arch 2022-11-28, Service Arch 2022-12-12, Service Arch 2023-01-09, Service Arch 2023-01-23, Service Arch 2023-02-06, Service Arch 2023-02-20, Service Arch 2023-03-06, Service Arch 2023-03-20, Service Arch 2023-04-03

      It seems that SERVER-57466 broke the TCP Keepalive parameter settings on Linux.

      I'm looking at this optval variable.
      https://github.com/10gen/mongo/pull/695/files#diff-19e9e1bf9007ae5e281e4d8f2c2b4704547ad7917c3557867bf91fdc45e18601L155

      Previously it was set to 1 and then overwritten by getsockopt.
      The value retrieved by getsockopt is compared against a maxval to determine if clipping is necessary, and if so, a setsockopt overwrites the value attached to the socket.

      But in SERVER-57466, the rawOptVal read by getsockopt is discarded.
      The optVal variable is never rewritten at all, and the clipping never occurs because 1 second is never greater than the maxVal variable, which is a constant that's either 300 or 1 second depending on the call site.

      So the setsockopt to configure TCP_KEEPIDLE and TCP_KEEPINTVL never happen.

            Assignee:
            billy.donahue@mongodb.com Billy Donahue
            Reporter:
            billy.donahue@mongodb.com Billy Donahue
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: