Bug #2880
Fix for mysql 'server has gone away' under passenger
| Status: | Duplicate | Start: | 11/30/2009 | |
|---|---|---|---|---|
| Priority: | Normal | Due date: | ||
| Assigned to: | % Done: | 0% |
||
| Category: | Rails | |||
| Target version: | - | |||
| Affected version: | 0.25.1 | Branch: | ||
| Keywords: | mysql passenger | |||
| Votes: | 0 |
Description
After moving my puppetmaster from webrick to passenger, I found that each backend puppetmaster instance would lose it database connection after the first client finished its run. Searching around, I found that recent versions of rails included a reconnect option, which fixed similar symptoms in other applications.
The attached patch appears to have fixed the glitch for me.
Gem versions:
activerecord (2.3.3) passenger (2.2.7) rack (1.0.1)
Related issues
| related to Puppet - Bug #2816: Storeconfigs - MySQL server has gone away | Closed | 11/13/2009 |
History
Updated by James Turnbull 8 months ago
- Status changed from Unreviewed to Needs design decision
- Assigned to set to Christian Hofstaedtler
Christian – any comments?
Updated by Christian Hofstaedtler 8 months ago
I’m seeing something similar on our 0.24.8 production setup, but this might really be some ActiveRecord concurrent connection usage thingy. Also mysql timeouts may play some game here. The key thing to find out really is: why is the connection going away.
Frank, can you check if the TCP connection to your mysqld is lost after the first run? (using netstat or similar), and, that this is not the case using webrick?
Updated by Frank Sweetser 8 months ago
Watching lsof, it looks like the connection is closed as soon as the run is completed under both webrick and passenger. I guess the question, then, is why it’s opening new connections under webrick but just failing under passenger.
Updated by Christian Hofstaedtler 8 months ago
- Status changed from Needs design decision to Needs more information
I can’t reproduce this with my test installation (1 master, 2 clients). Puppet HEAD, Passenger 2.2.7, activerecord 2.3.5, mysql.so 2.7.4-1 (from Debian). So the hard digging needs to be done on your setup, I’m afraid.
Updated by Frank Sweetser 8 months ago
Before I put on the arm-length gloves, what version of mysql did you test with? I’m currently using mysql-5.0.45 on Fedora 8 (yeah, I know it’s old, replacing it is part of what I’m working on now =)
Updated by Christian Hofstaedtler 8 months ago
My MySQL Server is 5.0.51a-24+lenny2.
Updated by Frank Sweetser 8 months ago
So it’s entirely possible, then, that I’m simply running into a bug in MySQL that webrick is somehow masking. I’m planning on migrating my puppetmaster over to a CentOS 5 box in the next couple of weeks, so I’ll repeat my testing then and see if my real issue is just running an old buggy OS.
And if that doesn’t work, then I’ll break out the hacksaw and start digging.
Updated by Markus Roberts 7 months ago
This may be a duplicate of #2816.
Updated by Christian Hofstaedtler 7 months ago
- Status changed from Needs more information to Duplicate