Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

MySQL connections not closed on restart

#86

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.

Reported by ronin-16982 (at lighthouseapp) · October 27th, 2008 @ 07:23 AM

State: invalid
Milestone: 1.1
Assigned to: macournoyer macournoyer

Activity

  1. Michael Klishin (antares)
    Michael Klishin (antares)

    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.

    October 27th, 2008 @ 11:26 AM

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

    October 27th, 2008 @ 11:32 AM

  3. macournoyer
    macournoyer
    • State changed from open to invalid

    no a thin issue it seems, reopen w/ more info if needed

    March 16th, 2009 @ 08:57 PM

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.