Bug #50881 Better logging of Tomcat's failed connection to mysql
Submitted: 3 Feb 2010 14:24 Modified: 8 Feb 2010 15:43
Reporter: Bogdan Kecman Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Enterprise Monitor: Server Severity:S4 (Feature request)
Version: OS:Any
Assigned to: CPU Architecture:Any

[3 Feb 2010 14:24] Bogdan Kecman
Description:

Tomcat (mem server) talks to the backend db via the agent/proxy

The agent died as it was killed by the OOM killer. So was mysqld.

After mysqld restarted, tomcat logs showed they could not reach the backend db, and this is because it was unable to reach agent/proxy that was not started. This was impossible to deduct from the log files.

How to repeat:
try to connect from tomcat to mysql via proxy that is not running
look at the log

Suggested fix:
Please log the database details which you can NOT connect to in tomcat.

Suggestion is that you log the hostname, port and user that you are trying to talk to.

Something like:

2010-02-03 10:02:24,869 WARN [main:com.mysql.sql] java.lang.Exception: MySQL server at mc01mon-03:4040 not running or accepting connections, retrying 37 times or 167
seconds, whichever expires first. Exception was: Communications link failure (user is service_manager)
[3 Feb 2010 21:54] Enterprise Tools JIRA Robot
Mark Matthews writes: 
Already fixed in 2.2 (where this code was cleaned up a bit).
[8 Feb 2010 15:43] MC Brown
A note has been added to the 2.2.0 changelog: 

        If the MySQL server holding the repository information for                                                                                         
        &merlin_server; crashes and you are using MySQL Proxy to                                                                                           
        monitor the backend server, the problem may be difficult to                                                                                        
        identify from the logs.