Forum: Ruby on Rails backgroundrb stops suddenly

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
265764299997c7176ca7316fc3bb87c7?d=identicon&s=25 Madhankumar Nagaraj (madhan)
on 2009-01-02 09:15
hi,
i have used backgroundrb to update the database with the files having
some useful data, where i am getting files periodically uploaded.
it works well, but suddenly it stops the worker and stopped the
updation.
when i checked the backgroundrb.log file
it shows
Mysql::Error: MySQL server has gone away: (Query used for updation)
LIMIT 1 - (ActiveRecord::StatementInvalid)
but, the query is working fine in mysql.

i have created one worker to do the updation with job_key.
when i checked the job_key value for the particular worker is shows nil.
since the worker was stopped.

what would be the problem, how can i make the updation works
continuously.

ur
madhan
C64e63b70be7dfed8b0742540b8b27e5?d=identicon&s=25 Mark Reginald James (Guest)
on 2009-01-02 12:52
(Received via mailing list)
Madhankumar Nagaraj wrote:
>
> i have created one worker to do the updation with job_key.
> when i checked the job_key value for the particular worker is shows nil.
> since the worker was stopped.
>
> what would be the problem, how can i make the updation works
> continuously.

Your MySQL session is timing-out after the default 8 hours.

Either increase the timeout by adding the following
line to the [mysqld] section of the /etc/my.cnf file:

   set-variable = wait_timeout=<#seconds>

or you can instead insert a call to

   ActiveRecord::Base.verify_active_connections!

ahead of any database queries.

The verify_active_connections! method is called by
Rails before every request, but your backgroundrb
process will not be getting this constant hammering
to keep its database connection alive.

--
Rails Wheels - Find Plugins, List & Sell Plugins -
http://railswheels.com
265764299997c7176ca7316fc3bb87c7?d=identicon&s=25 Madhankumar Nagaraj (madhan)
on 2009-01-02 13:18
> Your MySQL session is timing-out after the default 8 hours.
>
> Either increase the timeout by adding the following
> line to the [mysqld] section of the /etc/my.cnf file:
>
>    set-variable = wait_timeout=<#seconds>
>
> or you can instead insert a call to
>
>    ActiveRecord::Base.verify_active_connections!
>
> ahead of any database queries.
>
> The verify_active_connections! method is called by
> Rails before every request, but your backgroundrb
> process will not be getting this constant hammering
> to keep its database connection alive.
>

Dear Mark,

first i want to thank for ur response,

i am not making the mysql to wait, every 15 minutes i am getting the
files uploaded. it works well for 1 week (avg) then it stops suddenly..


ur
Madhan
00e8233b7817ac14040f7928e6d4b889?d=identicon&s=25 John Yerhot (Guest)
on 2009-01-02 17:44
(Received via mailing list)
You might want to try the BackgrounDRb mail list also

http://rubyforge.org/mailman/listinfo/backgroundrb-devel

On Jan 2, 6:18 am, Madhankumar Nagaraj <rails-mailing-l...@andreas-
This topic is locked and can not be replied to.