Bug #69244 Documentation and code inconsistent wrt. back_log
Submitted: 15 May 2013 13:28 Modified: 16 May 2013 4:44
Reporter: Raghavendra Prabhu Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Options Severity:S3 (Non-critical)
Version:5.6.11 OS:Any
Assigned to: CPU Architecture:Any

[15 May 2013 13:28] Raghavendra Prabhu
Description:
The documentation and the code are inconsistent wrt. back_log 
variable.

Code:

  /* Fix back_log */
  if (back_log == 0 && (back_log= 50 + max_connections / 5) > 900)
    back_log= 900;

static Sys_var_ulong Sys_back_log(
       "back_log", "The number of outstanding connection requests "
       "MySQL can have. This comes into play when the main MySQL thread "
       "gets very many connection requests in a very short time",
       READ_ONLY GLOBAL_VAR(back_log), CMD_LINE(REQUIRED_ARG),
       VALID_RANGE(0, 65535), DEFAULT(0), BLOCK_SIZE(1));

===================================================================

Documentation: (https://dev.mysql.com/doc/refman/5.6/en/server-system-variables.html#sysvar_back_log )
..
-1 (autosized)
....
 As of MySQL 5.6.6, the default value is based on the following formula, capped to a limit of 900:

50 + (max_connections / 5)

Before 5.6.6, the default is 50.

----------------------------------------------------------------------------
So,

a) Instead of 0, it should be -1 in the code for DEFAULT and also 
in the 'if', to allow  for auto-sizing.

b) The code, currently, doesn't allow for back_log of 0, which
allows the system to define the queue based on SOMAXCONN -- refer to
http://linux.die.net/man/3/listen -- "A backlog argument of 0 may allow
the socket to accept connections, in which case the length of the listen
queue may be set to an implementation-defined minimum value. "

So, the documentation is correct here, but the code isn't.

How to repeat:
N/A

Suggested fix:
Fix the code.
[16 May 2013 4:44] MySQL Verification Team
Thank you for the report.