Bug #12674 Instance Manager: IM doesn't handle client connections correctly
Submitted: 19 Aug 2005 12:38 Modified: 4 Mar 2006 0:25
Reporter: Alexander Nozdrin Email Updates:
Status: Closed Impact on me:
None 
Category:Instance Manager Severity:S3 (Non-critical)
Version:5.0 OS:
Assigned to: Petr Chardin CPU Architecture:Any

[19 Aug 2005 12:38] Alexander Nozdrin
Description:
Sometimes when working with Instance Manager from 'mysql' (cmd-line tool), the following error appears:

ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
Connection id:    4
Current database: *** NONE ***

I'm not absolutely sure, but it looks as if Instance Manager has some timeout per connection. When the timeout expires, Instance Manager closes connection. So, when mysql tries to send next command it discovers that connection is closed.

How to repeat:
1. Start Instance Manager;
2. Start 'mysql' and connect to the Instance Manager;
3. Execute any command (SHOW INSTANCES, for one);
4. Wait some time (5 minutes is absolutely enough);
5. Execute any command again (SHOW INSTANCES). The error should appear.
In the Instance Manager's log connection identifier should be increased (means that IM opens a new connection);
[15 Oct 2005 12:05] Valeriy Kravchuk
Thank you for a bug report. I was able to verify on IM from the latest 5.0.16-BK just as described:

[openxs@Fedora 5.0]$ libexec/mysqlmanager >/dev/null 2>&1 &
[1] 16072
[openxs@Fedora 5.0]$ bin/mysql -uvk -p --socket=/tmp/mysqlmanager.sock
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1 to server version: 0.2-alpha

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> show instances;
+---------------+---------+
| instance_name | status  |
+---------------+---------+
| mysqld        | offline |
+---------------+---------+
1 row in set (0,00 sec)

... waited for about 10 minutes here

mysql> show instances;
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
[16 Oct 2005 2:00] Brian Aker
Is the timeout not currently configurable via the my.cnf?
[16 Oct 2005 2:01] Brian Aker
Is the timeout not currently configurable via the my.cnf?
[3 Nov 2005 9:14] mike mike
i've noticed this as well.

perhaps when being designed it was assumed someone wouldn't be logged in to the IM for a long time?

i'd say as a feature request the timeout can be set, just like with the normal mysql server's client... but i wouldn't consider it to be a high priority (since it auto-reconnects)
[20 Feb 2006 23:25] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/2939
[21 Feb 2006 10:45] Konstantin Osipov
Approved over email.
[21 Feb 2006 12:31] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/2969
[21 Feb 2006 13:44] Petr Chardin
I've added an option to the Instance Manager:
--wait-timeout. It allows to set the number of seconds, IM waits 
for activity on a connection before closing it.
The default is also increased to be 8hrs (as in the server)
puhsed into 5.0.18
[21 Feb 2006 14:21] Konstantin Osipov
5.0.18 is released, 5.0.19 of course.
[4 Mar 2006 0:25] Paul Dubois
Noted in 5.0.19 changelog.

Added the <option>--wait-timeout</option> option to
<command>mysqlmanager</command> to allow configuration of the
timeout for dropping an inactive connection, and increased the
default timeout from 30 seconds to 28,800 seconds (8 hours).
(Bug #12674)