MySQL connections not closed on restart
Reported by Dieter Komendera | October 27th, 2008 @ 07:23 AM | in 1.1
Following setup:
thin 1.0.0 mysql 2.7 (the gem) rails 2.2 RC 1
How to reproduce it: * Take a rails app connected to a mysql database * Start thin as daemon * Make a request which uses the database * Restart thin with 'thin restart'
Expected result: No open database connection
Actual result: 1 open database connection
(I watched the connections with the MySQL Administrator app)
When you repeat that several times, you end up with many stale database connections. This makes it easy to hit the max connections limit on a server and could crash the whole app because newly restarted thins may not be able to connect to the database any more.
Doing this with mongrel, the database connections are closed properly on 'mongrel_rails restart'.
Possible workaround: Perform a 'thin stop' and start the server again.
Comments and changes to this ticket
-
Michael Klishin (antares) October 27th, 2008 @ 11:26 AM
How is it a Thin issue? It's clearly up to MySQL driver or ActiveRecord developers. Thin knows nothing about databases at all, hence it does not open any connections.
-
macournoyer October 27th, 2008 @ 11:33 AM
- → Milestone changed from Future to 1.1
- → State changed from new to open
I doubt this is a Thin issue too, since restart does a stop + start internally.
I'll test it when I get a minute.
Please Login or create a free account to add a new comment.
You can update this ticket by sending an email to from your email client. (help)
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
