MySQL connections not closed on restart
Reported by ronin-16982 (at lighthouseapp) | 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:32 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.
-
macournoyer March 16th, 2009 @ 08:57 PM
- State changed from open to invalid
no a thin issue it seems, reopen w/ more info if needed
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป