LiteSpeed Technologies
Download Download     Blog Blog     Wiki Wiki     Forum Forum     Store     Contact Contact    

Go Back   LiteSpeed Support Forums > External Applications > Ruby/Rails > MySQL Errors After Restarting

Reply
 
Thread Tools Display Modes
  #1  
Old 01-09-2009, 08:33 AM
kmarsh kmarsh is offline
New Member
 
Join Date: Jan 2009
Posts: 3
Default MySQL Errors After Restarting

I'm hosting a Rails app on litespeed via lsapi. Everything works great, but recently I've noticed errors after restarting after a re-deploy.

I get lots of MySQL connection errors (i.e., Lost connection to MySQL during query errors, etc.) from ActiveRecord right after the restart. It seems as though litespeed is killing off running ruby processes, or severing their MySQL connection somehow.

Any ideas?

Thanks,
Kevin

Versions: litespeed v3.3.23, ruby 1.8.6, Rails 2.2
Reply With Quote
  #2  
Old 01-10-2009, 09:13 AM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,603
what is the error? Does it affect the service? or just happened when LiteSpeed stop ruby processes?
Reply With Quote
  #3  
Old 01-10-2009, 09:21 AM
kmarsh kmarsh is offline
New Member
 
Join Date: Jan 2009
Posts: 3
"ActiveRecord::StatementInvalid: Mysql::Error: Lost connection to MySQL server during query" is the most common error.

Any requests that are being processed while the deploy is happening are 500'ing.
Reply With Quote
  #4  
Old 01-10-2009, 09:25 AM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,603
make sure your lsws/fcgi-bin/RailsRunner.rb is patched like in

http://www.litespeedtech.com/support...ead.php?t=2493
Reply With Quote
  #5  
Old 01-10-2009, 10:48 AM
kmarsh kmarsh is offline
New Member
 
Join Date: Jan 2009
Posts: 3
I replaced

ActiveRecord::Base.clear_active_connections! if defined?(ActiveRecord::Base)

with

ActiveRecord::Base.connection.disconnect! and @reconnect = true if defined?(ActiveRecord::Base)

I'll report back on status after I do a couple redeploys.

Thanks,
Kevin
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 05:53 PM.



- Archive - Top
© Copyright 2003-2011 LiteSpeed Technologies, Inc. All rights reserved. Privacy Policy.