Bug #41302 wait_timeout problem!!!
Submitted: 8 Dec 2008 14:21 Modified: 14 Dec 2008 7:55
Reporter: Yan Nagler Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Documentation Severity:S1 (Critical)
Version:5.0.45, 5.1.30 OS:Linux
Assigned to: Paul DuBois CPU Architecture:Any
Tags: Connection, wait_timeout

[8 Dec 2008 14:21] Yan Nagler
Description:
Hello!
I've read, that the maximal value that the wait_timeout variable can get is 31536000, an equivalency of 365 days in seconds.
We have the situation, when out NTP server responds late, so we start the system with 01/01/1970 and about a minute later the time changed to the current, which is different at almost 40 years. Thus all the connections get broken!
The user must be able to change the time of the system, and the system must resist that!
I know that wait_timeout variable is of type 'long int', so the maximal value it may hold is 2G. Why it is impossible to set this value? Or, what do I change to force the MySQL to accept this?
I do not want to fix this problem at API level. I think this is not right. I want to have permanent connections.

Will be glad for an answer,
Sincerely,
Yan Nagler

How to repeat:
1. Start the mysql
2. Start any software client
3. Change the system time
[8 Dec 2008 14:45] Valeriy Kravchuk
Thank you for a problem report. I do not see maximum possible value for wait_timeout documented at http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html#sysvar_wait_timeout, so this is a valid documentation request at least.
[8 Dec 2008 15:17] Yan Nagler
Thank you for a qiuck response!
What do you mean by saying "valid documentation request"? Do I have any solution for this, very critical for me, issue?

Yan Nagler
[12 Dec 2008 19:07] Paul DuBois
Thank you for your bug report. This issue has been addressed in the documentation. The updated documentation will appear on our website shortly, and will be included in the next release of the relevant products.

The minimum value is 1.
The maximum value is 31536000, except it's 2147483 on Windows.

The setting will not compensate for changes made to your system time by NTP. The timeout works as a calculation of the time the system clock must reach before timeout occurs. It does not work as a timer that counts down.
[14 Dec 2008 7:55] Yan Nagler
Hello!
Thanks for the response. This is what we did:
We opened the code, changed the constant (the variable is of long int type, so it can handle values up to 2G), recompiled the DBMS and substituted the mysqld module. Now we can update the GLOBAL wait_timeout variable to relatively big values.
I still wonder why this feature is not part of the release. Some users wants to have permanent connections. Especially when using prepared statements.

Thank again,
Yan Nagler