MySQL Errors After Restarting

Discussion in 'Ruby/Rails' started by kmarsh, Jan 9, 2009.

  1. kmarsh

    kmarsh New Member

    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
  2. mistwang

    mistwang LiteSpeed Staff

    what is the error? Does it affect the service? or just happened when LiteSpeed stop ruby processes?
  3. kmarsh

    kmarsh New Member

    "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.
  4. mistwang

    mistwang LiteSpeed Staff

  5. kmarsh

    kmarsh New Member

    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

Share This Page