#86 ✓invalid
ronin-16982 (at lighthouseapp)

MySQL connections not closed on restart

Reported by ronin-16982 (at lighthouseapp) | 2008-10-27 07:23:01 UTC | 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)

    Michael Klishin (antares) 2008-10-27 11:26:41 UTC

    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

    macournoyer 2008-10-27 11:32:59 UTC

    • 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

    macournoyer 2009-03-16 20:57:09 UTC

    • 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.

New ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

People watching this ticket

Pages