apr-bugs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 59272] New: TCP_DEFER_ACCEPT socket option treated as a toggle, not a timeout
Date Mon, 04 Apr 2016 19:16:57 GMT

            Bug ID: 59272
           Summary: TCP_DEFER_ACCEPT socket option treated as a toggle,
                    not a timeout
           Product: APR
           Version: 1.5.2
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: APR
          Assignee: bugs@apr.apache.org
          Reporter: lscotte@gmail.com

For reference, see Bug 41270 for Apache - "TCP_DEFER_ACCEPT timeout set way too

The TCP_DEFER_ACCEPT option in APR is treated effectively as a toggle, rather
than a timeout, similar to the Apache issue referenced above. Setting a value
of "1" effectively tells the kernel to drop sockets if no data is received for
a few seconds (not 1 second due to synack_retries). On Linux, this socket
option specified a timeout value.

>From the tcp(7) manpage for Linux:

  TCP_DEFER_ACCEPT (since Linux 2.4)
    Allow  a  listener  to  be awakened only when data arrives on the socket.
    Takes an integer value (seconds), this can bound the maximum number of
    attempts TCP will make to complete the connection. This option should not
    used  in code intended to be portable.

In Apache, the value was changed to 30 (seconds) since 2.2.28 and 2.4.x, as a
value of 1 can pose issues with load balancers. Although one can clearly turn
off this option (deferAccept in Tomcat when using libapr, for example), because
it is enabled by default when supported, APR should use a more sensible default
value - ideally the same as Apache.

See the Apache bug for additional details, and notes how behavior for Linux is
different than BSD.

Relevant code is around line 210 in network_io/unix/sockopt.c.

[1] https://bz.apache.org/bugzilla/show_bug.cgi?id=41270

You are receiving this mail because:
You are the assignee for the bug.

To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org

View raw message