[Backgroundrb-devel] error: no marshal_dump is defined for class Thread

hemant gethemant at gmail.com
Fri Dec 28 02:09:25 EST 2007


On Dec 28, 2007 1:44 AM, hemant <gethemant at gmail.com> wrote:
>
> On Dec 28, 2007 1:34 AM, Jason LaPier <jason.lapier at gmail.com> wrote:
> >
> > On Dec 27, 2007 1:13 AM, hemant <gethemant at gmail.com> wrote:
> > >
> > > On Dec 25, 2007 10:59 AM, hemant kumar <gethemant at gmail.com> wrote:
> > > >
> > > >
> > > > On Mon, 2007-12-24 at 17:32 -0800, Jason LaPier wrote:
> > > > > I get this error periodically in backgroundrb.log, but only on my
> > > > > production box (the one running ruby 1.8.5) - my dev box doesn't get
> > > > > this error. As far as I can tell, everything is working ok, despite
> > > > > the error (I don't really know how to determine if the jobs are
> > > > > getting threaded successfully, but they are running, that I am sure
> > > > > of).
> > > > >
> > > > >
> > > > > Here's the dump:
> > > > >
> > > > > no marshal_dump is defined for class Thread
> > > > >
> > > > > /var/www/apps/rpg/releases/20071224050255/vendor/plugins/backgroundrb/lib/../framework/nbio.rb:55:in
> > > > > `dump'
> > > > >
> > > > > /var/www/apps/rpg/releases/20071224050255/vendor/plugins/backgroundrb/lib/../framework/nbio.rb:55:in
> > > > > `dump_object'
> > > > >
> > > > > /var/www/apps/rpg/releases/20071224050255/vendor/plugins/backgroundrb/framework/worker.rb:32:in
> > > > > `send_data'
> > > > >
> > > > > /var/www/apps/rpg/releases/20071224050255/vendor/plugins/backgroundrb/server/meta_worker.rb:291:in
> > > > > `send_response'
> > > > >
> > > > > /var/www/apps/rpg/releases/20071224050255/vendor/plugins/backgroundrb/server/meta_worker.rb:224:in
> > > > > `process_request'
> > > > >
> > > > > /var/www/apps/rpg/releases/20071224050255/vendor/plugins/backgroundrb/server/meta_worker.rb:202:in
> > > > > `receive_data'
> > > > >
> > > > > /var/www/apps/rpg/releases/20071224050255/vendor/plugins/backgroundrb/framework/worker.rb:54:in
> > > > > `receive_internal_data'
> > > > >
> > > > > /var/www/apps/rpg/releases/20071224050255/vendor/plugins/backgroundrb/lib/../framework/bin_parser.rb:29:in
> > > > > `call'
> > > > >
> > > > > /var/www/apps/rpg/releases/20071224050255/vendor/plugins/backgroundrb/lib/../framework/bin_parser.rb:29:in
> > > > > `extract'
> > > > >
> > > > > /var/www/apps/rpg/releases/20071224050255/vendor/plugins/backgroundrb/framework/worker.rb:52:in
> > > > > `receive_internal_data'
> > > > >
> > > > > /var/www/apps/rpg/releases/20071224050255/vendor/plugins/backgroundrb/framework/worker.rb:48:in
> > > > > `handle_internal_messages'
> > > > >
> > > > > /var/www/apps/rpg/releases/20071224050255/vendor/plugins/backgroundrb/framework/core.rb:158:in
> > > > > `start_reactor'
> > > > >
> > > > > /var/www/apps/rpg/releases/20071224050255/vendor/plugins/backgroundrb/framework/core.rb:156:in
> > > > > `each'
> > > > >
> > > > > /var/www/apps/rpg/releases/20071224050255/vendor/plugins/backgroundrb/framework/core.rb:156:in
> > > > > `start_reactor'
> > > > >
> > > > > /var/www/apps/rpg/releases/20071224050255/vendor/plugins/backgroundrb/framework/core.rb:147:in
> > > > > `loop'
> > > > >
> > > > > /var/www/apps/rpg/releases/20071224050255/vendor/plugins/backgroundrb/framework/core.rb:147:in
> > > > > `start_reactor'
> > > > >
> > > > > /var/www/apps/rpg/releases/20071224050255/vendor/plugins/backgroundrb/framework/worker.rb:21:in
> > > > > `start_worker'
> > > > >
> > > > > /var/www/apps/rpg/releases/20071224050255/vendor/plugins/backgroundrb/framework/packet_master.rb:134:in
> > > > > `fork_and_load'
> > > > >
> > > > > /var/www/apps/rpg/releases/20071224050255/vendor/plugins/backgroundrb/framework/packet_master.rb:98:in
> > > > > `load_workers'
> > > > >
> > > > > /var/www/apps/rpg/releases/20071224050255/vendor/plugins/backgroundrb/framework/packet_master.rb:93:in
> > > > > `each'
> > > > >
> > > > > /var/www/apps/rpg/releases/20071224050255/vendor/plugins/backgroundrb/framework/packet_master.rb:93:in
> > > > > `load_workers'
> > > > >
> > > > > /var/www/apps/rpg/releases/20071224050255/vendor/plugins/backgroundrb/framework/packet_master.rb:19:in
> > > > > `run'
> > > > >
> > > > > /var/www/apps/rpg/releases/20071224050255/vendor/plugins/backgroundrb/server/master_worker.rb:144:in
> > > > > `initialize'
> > > > >
> > > > > script/backgroundrb:41:in `new'
> > > > >
> > > > > script/backgroundrb:41
> > > >
> > > > Looks your code is trying to dump threads, somewhere!
> > > >
> > > > I will have a look..anyways. And if jobs are running means, there are
> > > > getting threaded successfully.
> > >
> > > Jason, did you debug this further? Why you are getting those errors
> > > logged? Can you send me worker code, if possible?
> > >
> >
> > Sorry, hemant - I didn't track down the problem. It appeared that
> > mongrel processes were hanging on me, and these seemed to coincide
> > with those errors, but I can't be 100% sure. This was a Fedora Core 6
> > box and the repositories only have ruby 1.8.5, so in desperation I
> > yanked it out and compiled Ruby 1.8.6 and reinstalled all the gems.
> > The Thread error is gone now - it could be the updated ruby, or it
> > could be that when I reinstalled I got a newer version of mongrel than
> > I had before.
> >
> > I am however still getting occasional hung mongrels. Here are some
> > errors popping up in the logs:
> >
> > --background_server.log--
> > "production"
> > /var/www/apps/rpg/releases/20071224050255/vendor/plugins/backgroundrb/server/meta_worker.rb:70:in
> > `add_thread': undefined local variable or method `logger' for
> > #<BackgrounDRb::ThreadPool:0xb790006c> (NameError)
> >         from /var/www/apps/rpg/releases/20071224050255/vendor/plugins/backgroundrb/server/meta_worker.rb:62:in
> > `initialize'
> >         from /var/www/apps/rpg/releases/20071224050255/vendor/plugins/backgroundrb/server/meta_worker.rb:62:in
> > `new'
> >         from /var/www/apps/rpg/releases/20071224050255/vendor/plugins/backgroundrb/server/meta_worker.rb:62:in
> > `add_thread'
> >         from /var/www/apps/rpg/releases/20071224050255/vendor/plugins/backgroundrb/server/meta_worker.rb:34:in
> > `initialize'
> >         from /var/www/apps/rpg/releases/20071224050255/vendor/plugins/backgroundrb/server/meta_worker.rb:34:in
> > `times'
> >         from /var/www/apps/rpg/releases/20071224050255/vendor/plugins/backgroundrb/server/meta_worker.rb:34:in
> > `initialize'
> >         from /var/www/apps/rpg/releases/20071224050255/vendor/plugins/backgroundrb/server/meta_worker.rb:169:in
> > `new'
> >         from /var/www/apps/rpg/releases/20071224050255/vendor/plugins/backgroundrb/server/meta_worker.rb:169:in
> > `worker_init'
> >         from /var/www/apps/rpg/releases/20071224050255/vendor/plugins/backgroundrb/framework/worker.rb:20:in
> > `start_worker'
> >         from /var/www/apps/rpg/releases/20071224050255/vendor/plugins/backgroundrb/framework/packet_master.rb:134:in
> > `fork_and_load'
> >         from /var/www/apps/rpg/releases/20071224050255/vendor/plugins/backgroundrb/framework/packet_master.rb:98:in
> > `load_workers'
> >         from /var/www/apps/rpg/releases/20071224050255/vendor/plugins/backgroundrb/framework/packet_master.rb:93:in
> > `each'
> >         from /var/www/apps/rpg/releases/20071224050255/vendor/plugins/backgroundrb/framework/packet_master.rb:93:in
> > `load_workers'
> >         from /var/www/apps/rpg/releases/20071224050255/vendor/plugins/backgroundrb/framework/packet_master.rb:19:in
> > `run'
> >         from /var/www/apps/rpg/releases/20071224050255/vendor/plugins/backgroundrb/server/master_worker.rb:144:in
> > `initialize'
> >         from script/backgroundrb:41:in `new'
> >         from script/backgroundrb:41
> >
> > --background_debug.log--
> > 000000087{      :       type:
> >                              do_work:   datai: worker_method: build_battle:
> >
> >     worker: battle_builder_worker
> > {:type=>:do_work, :worker=>:battle_builder_worker, :data=>2,
> > :worker_method=>:build_battle}
> > undefined method `send_request' for nil:NilClass
> > /var/www/apps/rpg/releases/20071224050255/vendor/plugins/backgroundrb/framework/packet_master.rb:43:in
> > `ask_worker'
> > /var/www/apps/rpg/releases/20071224050255/vendor/plugins/backgroundrb/server/master_worker.rb:87:in
> > `process_work'
> > /var/www/apps/rpg/releases/20071224050255/vendor/plugins/backgroundrb/server/master_worker.rb:35:in
> > `receive_data'
> > /var/www/apps/rpg/releases/20071224050255/vendor/plugins/backgroundrb/lib/../framework/bin_parser.rb:29:in
> > `call'
> > /var/www/apps/rpg/releases/20071224050255/vendor/plugins/backgroundrb/lib/../framework/bin_parser.rb:29:in
> > `extract'
> > /var/www/apps/rpg/releases/20071224050255/vendor/plugins/backgroundrb/server/master_worker.rb:31:in
> > `receive_data'
> > /var/www/apps/rpg/releases/20071224050255/vendor/plugins/backgroundrb/framework/core.rb:199:in
> > `read_external_socket'
> > /var/www/apps/rpg/releases/20071224050255/vendor/plugins/backgroundrb/framework/core.rb:191:in
> > `handle_external_messages'
> > /var/www/apps/rpg/releases/20071224050255/vendor/plugins/backgroundrb/framework/core.rb:160:in
> > `start_reactor'
> > /var/www/apps/rpg/releases/20071224050255/vendor/plugins/backgroundrb/framework/core.rb:156:in
> > `each'
> > /var/www/apps/rpg/releases/20071224050255/vendor/plugins/backgroundrb/framework/core.rb:156:in
> > `start_reactor'
> > /var/www/apps/rpg/releases/20071224050255/vendor/plugins/backgroundrb/framework/core.rb:147:in
> > `loop'
> > /var/www/apps/rpg/releases/20071224050255/vendor/plugins/backgroundrb/framework/core.rb:147:in
> > `start_reactor'
> > /var/www/apps/rpg/releases/20071224050255/vendor/plugins/backgroundrb/framework/packet_master.rb:20:in
> > `run'
> > /var/www/apps/rpg/releases/20071224050255/vendor/plugins/backgroundrb/server/master_worker.rb:144:in
> > `initialize'
> > script/backgroundrb:41:in `new'
> > script/backgroundrb:41
> >
> > When this happens, backgroundrb seems to be working (I see the
> > requests in the log) but jobs never execute. I have to stop
> > backgroundrb and restart it. From what I can tell, it doesn't hang all
> > the mongrels, just one of the four I have running.
> >
> > The first error, it's obviously trying to log an exception but can't
> > find logger. The second error looks like it can't find the worker
> > (getting Nil instead of the worker). I wasn't checking for the
> > existence of the worker before I call MiddleMan.ask_work because it's
> > supposed to be running at all times (maybe I need to do that anyway
> > for troubleshooting purposes).
> >
> > I'll keep poking around and see if I can figure anything out. The
> > problem is very intermittent - it ran fine for several hours and the
> > job in the worker was called at least 20 times; so I thought the
> > upgrade to ruby 1.8.6 and/or mongrel 1.1.2 had taken care of it, but
> > then I got those errors above today and had to restart backgroundrb.
> >
> >
>
> This is awesome. Lets fix it.

Can you send me your worker code Jason?

-- 
Let them talk of their oriental summer climes of everlasting
conservatories; give me the privilege of making my own summer with my
own coals.

http://gnufied.org


More information about the Backgroundrb-devel mailing list