Bug #15679 wait_timeout does not work as expected
Submitted: 12 Dec 2005 11:23 Modified: 28 Jan 2006 6:08
Reporter: Andrejs Dubovskis Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:4.1.15-standard-log OS:HP/UX (HP-UX 11.11 PA-RISC2.0-64bit)
Assigned to: CPU Architecture:Any

[12 Dec 2005 11:23] Andrejs Dubovskis
Description:
Session does not closed on server after specified wait_timeout value.
Problem found in case of 64 bit client only.

We have tested 2 clients:
* PARISC 2.0 - 64 bit (local connection)
* ia64 (RHEL) (network connection)

and found, that values prior 255 work as expected.
But starting from 255 sessions do not terminated on server.

How to repeat:
On the client host run 'mysql' shell and issue SQL command:
set local wait_timeout=255;

Session still presents on server after specified timeout value.

| 20142352 | root       | localhost                         | NULL             | Sleep   |   315 |       | NULL             |
| 20142535 | root       | localhost                         | NULL             | Query   |     0 | NULL  | show processlist |
[12 Dec 2005 13:13] Valeriy Kravchuk
Thank you for a problem report. I was not able to repeat the problem you described with 4.1.17 on 32-bit Linux, by the way. I'll keep trying on HP-UX and/or 64-bit Linux. But, please, check it once more.
[12 Dec 2005 13:36] Andrejs Dubovskis
I was checked 32bit client prior bug submition and did not faced with this error. In all my tests I had connected to HPUX mysql server (built by mysql.com).

After additional test I would like to confirm, that problem is repeatable on my site.
[13 Dec 2005 14:51] Valeriy Kravchuk
Sorry, but I was not able to repeat on HP-UX 11.11 too, with 4.1.15 built from the official sources just as it always done on this platform. I performed the following test. In session 1:

4.1> bin/mysqld_safe --skip-networking --socket=/home/mysqldev/valeriy/mysql4.sock &
[1] 12801
4.1> Starting mysqld daemon with databases from /home/mysqldev/valeriy/dbs/4.1/var

4.1> bin/mysql --socket=/home/mysqldev/valeriy/mysql4.sock -uroot
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1 to server version: 4.1.15

No entry for terminal type "xterm";
using dumb terminal settings.
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> show processlist;
+----+------+-----------+------+---------+------+-------+------------------+
| Id | User | Host      | db   | Command | Time | State | Info             |
+----+------+-----------+------+---------+------+-------+------------------+
|  1 | root | localhost | NULL | Query   |    0 | NULL  | show processlist |
+----+------+-----------+------+---------+------+-------+------------------+
1 row in set (0.01 sec)

Then, in session 2:

mysqldev> cd valeriy/dbs/4.1/
4.1>  bin/mysql --socket=/home/mysqldev/valeriy/mysql4.sock -uroot
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2 to server version: 4.1.15

No entry for terminal type "xterm";
using dumb terminal settings.
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> set local wait_timeout=255;
Query OK, 0 rows affected (0.26 sec)

In session 1:

mysql> show processlist;
+----+------+-----------+------+---------+------+-------+------------------+
| Id | User | Host      | db   | Command | Time | State | Info             |
+----+------+-----------+------+---------+------+-------+------------------+
|  1 | root | localhost | NULL | Query   |    0 | NULL  | show processlist |
|  2 | root | localhost | NULL | Sleep   |    3 |       | NULL             |
+----+------+-----------+------+---------+------+-------+------------------+
2 rows in set (0.00 sec)

mysql> show processlist;
+----+------+-----------+------+---------+------+-------+------------------+
| Id | User | Host      | db   | Command | Time | State | Info             |
+----+------+-----------+------+---------+------+-------+------------------+
|  1 | root | localhost | NULL | Query   |    0 | NULL  | show processlist |
|  2 | root | localhost | NULL | Sleep   |   51 |       | NULL             |
+----+------+-----------+------+---------+------+-------+------------------+
2 rows in set (0.00 sec)

mysql> show processlist;
+----+------+-----------+------+---------+------+-------+------------------+
| Id | User | Host      | db   | Command | Time | State | Info             |
+----+------+-----------+------+---------+------+-------+------------------+
|  1 | root | localhost | NULL | Query   |    0 | NULL  | show processlist |
|  2 | root | localhost | NULL | Sleep   |  107 |       | NULL             |
+----+------+-----------+------+---------+------+-------+------------------+
2 rows in set (0.00 sec)

and, after waiting more than 255 seconds:

mysql> show processlist;
+----+------+-----------+------+---------+------+-------+------------------+
| Id | User | Host      | db   | Command | Time | State | Info             |
+----+------+-----------+------+---------+------+-------+------------------+
|  1 | root | localhost | NULL | Query   |    0 | NULL  | show processlist |
+----+------+-----------+------+---------+------+-------+------------------+
1 row in set (0.00 sec)

mysql> exit
Bye
4.1> file bin/mysql
bin/mysql:      ELF-64 executable object file - PA-RISC 2.0 (LP64)
4.1> uname -a
HP-UX hpux11 B.11.11 U 9000/800 807910656 unlimited-user license

So, it is HP-UX, and 64-bit binary, and version 4.1.15.

In session 2:

mysql> select version();
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
Connection id:    3
Current database: *** NONE ***

+-----------+
| version() |
+-----------+
| 4.1.15    |
+-----------+
1 row in set (0.06 sec)

mysql> exit
Bye

I had build and installed MySQL using the following commands:

export PATH=/home/mysqldev/hpux11-64bit/bin:/usr/bin:/opt/ansic/bin:/usr/ccs/bin:/opt/hparray/bin:/opt/nettladm/bin:/opt/upgrade/bin:/opt/fcms/bin:/opt/pd/bin:/usr/bin/X11:/usr/contrib/bin/X11:/opt/mx/bin:/opt/atok/bin:/opt/egb/bin:/opt/resmon/bin:/opt/scr/bin:/opt/vje/bin:/opt/aCC/bin:/opt/langtools/bin:/opt/perf/bin://opt/perl/bin:/opt/imake/bin:/usr/sbin/diag/contrib:/usr/contrib/bin:/usr/local/bin

CC=cc CFLAGS='-O +DD64' CXXFLAGS='+O2 +DD64 -Aa' CXX=aCC LDFLAGS=+DD64 ./configure --prefix=/home/mysqldev/valeriy/dbs/4.1 --disable-shared --with-zlib-dir=bundled

make
make install
cd ../dbs/4.1/
bin/mysql_install_db

And then performed just the test described. 

So, please, check once more (with sockets) and inform about the results. May be, the problem appears only when connecting through ports (I can't use this way of connection right now on that machine).
[3 Jan 2006 11:37] Andrejs Dubovskis
After mysqld restart I had executed the test on the same machine and same software. And can not repeat. Sorry, you can close the case.
[3 Jan 2006 13:42] Valeriy Kravchuk
Closed, because neither me, nor the original reporter (see the previous message) were able to repeat the problem described.
[28 Jan 2006 6:08] Aleksey Kishkin
duplicate of http://bugs.mysql.com/bug.php?id=11897