[Backgroundrb-devel] Exception when doing DRb remote calls from a BackgrounDRb worker

Sergio Espeja sergio.espeja at gmail.com
Wed Apr 4 09:49:14 EDT 2007


Hi Geoff,

The error is inside the worker and is dumped into log/backgroundrb.log, the
rails application doesn't notice it.

I think I didn't explain me well, the backgroundrb worker starts and do its
work well until it haves to make a remote call to a remote object using ruby
DRb. The whole dump is:

 ERROR: drbunix:///tmp/backgroundrb.11251/experimenter_worker_fd50c992d69cc4395c8798878fb4231b_0_0.338539203351759
- #<Errno::ENOENT: No such file or directory -
///tmp/backgroundrb.11251/experimenter_worker_fd50c992d69cc4395c8798878fb4231b_0_0.338539203351759>

20070404-13:41:30 (11255) (druby://externalserver:36865)
/usr/lib/ruby/1.8/drb/drb.rb:733:in `open'
(druby://externalserver:36865) /usr/lib/ruby/1.8/drb/drb.rb:726:in `open'
(druby://externalserver:36865) /usr/lib/ruby/1.8/drb/drb.rb:1186:in
`initialize'
(druby://externalserver:36865) /usr/lib/ruby/1.8/drb/drb.rb:1166:in `open'
(druby://externalserver:36865) /usr/lib/ruby/1.8/drb/drb.rb:1082:in
`method_missing'
(druby://externalserver:36865) /usr/lib/ruby/1.8/drb/drb.rb:1100:in
`with_friend'
(druby://externalserver:36865) /usr/lib/ruby/1.8/drb/drb.rb:1081:in
`method_missing'
(druby://externalserver:36865) ./drb_method_executer.rb:27:in
`method_missing'
(druby://externalserver:36865) /usr/lib/ruby/1.8/drb/drb.rb:1552:in
`perform_without_block'
(druby://externalserver:36865) /usr/lib/ruby/1.8/drb/drb.rb:1512:in
`perform'
(druby://externalserver:36865) /usr/lib/ruby/1.8/drb/drb.rb:1586:in
`main_loop'
(druby://externalserver:36865) /usr/lib/ruby/1.8/drb/drb.rb:1582:in
`main_loop'
(druby://externalserver:36865) /usr/lib/ruby/1.8/drb/drb.rb:1578:in
`main_loop'
(druby://externalserver:36865) /usr/lib/ruby/1.8/drb/drb.rb:1427:in `run'
(druby://externalserver:36865) /usr/lib/ruby/1.8/drb/drb.rb:1424:in `run'
(druby://externalserver:36865) /usr/lib/ruby/1.8/drb/drb.rb:1344:in
`initialize'
(druby://externalserver:36865) /usr/lib/ruby/1.8/drb/drb.rb:1624:in
`start_service'
(druby://externalserver:36865) ./drb_method_executer.rb:101:in
`start_up_executer_service'
(druby://externalserver:36865) ./startup:5
/home/espeja/Workspaces/eclipseRoR/wsaaile/config/../lib/gga4r/drb_method_executer.rb:66:in
`execute'
/home/espeja/Workspaces/eclipseRoR/wsaaile/config/../lib/gga4r/gga4r_main.rb:152:in
`evaluation_with_drb'
/home/espeja/Workspaces/eclipseRoR/wsaaile/config/../lib/gga4r/gga4r_main.rb:147:in
`evaluation_with_drb'
/home/espeja/Workspaces/eclipseRoR/wsaaile/config/../lib/gga4r/gga4r_main.rb:85:in
`evolve'
/home/espeja/Workspaces/eclipseRoR/wsaaile/config/../lib/gga4r/gga4r_main.rb:82:in
`evolve'
/home/espeja/Workspaces/eclipseRoR/wsaaile/config/../lib/ga_for_aaile.rb:257:in
`ga_for_signature'
/home/espeja/Workspaces/eclipseRoR/wsaaile/config/../lib/ga_for_aaile.rb:256:in
`ga_for_signature'
/home/espeja/Workspaces/eclipseRoR/wsaaile/lib/workers/experimenter_worker.rb:248:in
`do_calculate_experiment_results_for_ga'
/home/espeja/Workspaces/eclipseRoR/wsaaile/lib/workers/experimenter_worker.rb:246:in
`do_calculate_experiment_results_for_ga'
/home/espeja/Workspaces/eclipseRoR/wsaaile/lib/workers/experimenter_worker.rb:59:in
`do_work'
/home/espeja/Workspaces/eclipseRoR/wsaaile/vendor/plugins/backgroundrb/server/lib/backgroundrb/worker.rb:55:in
`work_thread'
/home/espeja/Workspaces/eclipseRoR/wsaaile/vendor/plugins/backgroundrb/server/lib/backgroundrb/worker.rb:69:in
`work_thread'
/home/espeja/Workspaces/eclipseRoR/wsaaile/vendor/plugins/backgroundrb/server/lib/backgroundrb/worker.rb:67:in
`work_thread'
/usr/lib/ruby/1.8/drb/drb.rb:1552:in `perform_without_block'
/usr/lib/ruby/1.8/drb/drb.rb:1512:in `perform'
/usr/lib/ruby/1.8/drb/drb.rb:1586:in `main_loop'
/usr/lib/ruby/1.8/drb/drb.rb:1582:in `main_loop'
/usr/lib/ruby/1.8/drb/drb.rb:1578:in `main_loop'
/usr/lib/ruby/1.8/drb/drb.rb:1427:in `run'
/usr/lib/ruby/1.8/drb/drb.rb:1424:in `run'
/usr/lib/ruby/1.8/drb/drb.rb:1344:in `initialize'
/usr/lib/ruby/1.8/drb/drb.rb:1624:in `start_service'
/usr/lib/ruby/gems/1.8/gems/slave-1.2.0/lib/slave.rb:396:in `initialize'
/usr/lib/ruby/gems/1.8/gems/slave-1.2.0/lib/slave.rb:391:in `initialize'
/home/espeja/Workspaces/eclipseRoR/wsaaile/vendor/plugins/backgroundrb/server/lib/backgroundrb/middleman.rb:210:in
`new_worker'
/home/espeja/Workspaces/eclipseRoR/wsaaile/vendor/plugins/backgroundrb/server/lib/backgroundrb/thread_pool.rb:36:in
`dispatch'
/home/espeja/Workspaces/eclipseRoR/wsaaile/vendor/plugins/backgroundrb/server/lib/backgroundrb/thread_pool.rb:22:in
`dispatch'
/home/espeja/Workspaces/eclipseRoR/wsaaile/vendor/plugins/backgroundrb/server/lib/backgroundrb/middleman.rb:199:in
`new_worker'
/usr/lib/ruby/1.8/drb/drb.rb:1552:in `perform_without_block'
/usr/lib/ruby/1.8/drb/drb.rb:1512:in `perform'
/usr/lib/ruby/1.8/drb/drb.rb:1586:in `main_loop'
/usr/lib/ruby/1.8/drb/drb.rb:1582:in `main_loop'
/usr/lib/ruby/1.8/drb/drb.rb:1578:in `main_loop'
/usr/lib/ruby/1.8/drb/drb.rb:1427:in `run'
/usr/lib/ruby/1.8/drb/drb.rb:1424:in `run'
/usr/lib/ruby/1.8/drb/drb.rb:1344:in `initialize'
/usr/lib/ruby/1.8/drb/drb.rb:1624:in `start_service'
/home/espeja/Workspaces/eclipseRoR/wsaaile/vendor/plugins/backgroundrb/server/lib/backgroundrb_server.rb:315:in
`run'
/usr/lib/ruby/gems/1.8/gems/daemons-1.0.3/lib/daemons/application.rb:186:in
`start_proc'
/usr/lib/ruby/gems/1.8/gems/daemons-1.0.3/lib/daemons/daemonize.rb:208:in
`call_as_daemon'
/usr/lib/ruby/gems/1.8/gems/daemons-1.0.3/lib/daemons/application.rb:190:in
`start_proc'
/usr/lib/ruby/gems/1.8/gems/daemons- 1.0.3/lib/daemons/application.rb:226:in
`start'
/usr/lib/ruby/gems/1.8/gems/daemons-1.0.3/lib/daemons/controller.rb:69:in
`run'
/usr/lib/ruby/gems/1.8/gems/daemons-1.0.3/lib/daemons.rb:179:in `run_proc'
/usr/lib/ruby/gems/1.8/gems/daemons-1.0.3/lib/daemons/cmdline.rb:94:in
`catch_exceptions'
/usr/lib/ruby/gems/1.8/gems/daemons-1.0.3/lib/daemons.rb:178:in `run_proc'
/home/espeja/Workspaces/eclipseRoR/wsaaile/vendor/plugins/backgroundrb/server/lib/backgroundrb_server.rb:301:in
`run'
script/backgroundrb:29
20070404-13:41:30 (11255) ERROR:
drbunix:///tmp/backgroundrb.11251/experimenter_worker_fd50c992d69cc4395c8798878fb4231b_0_0.338539203351759
- #<Errno::ENOENT: No such file or directory -
///tmp/backgroundrb.11251/experimenter_worker_fd50c992d69cc4395c8798878fb4231b_0_0.338539203351759>


I've marked what I think are the important lines. The orange one is executed
in the external server and is:
  DRb.start_service executer_service_url, drb_me
And the yellow one executes a remote object call:
@drb_querier.execute(chromosome, :fitness)
where @drb_querier.execute makes a call to a DRbObject

I hope I clarify more the question ;) I think that the problem is that isn't
still posible to execute methods on remote objects using DRb with
backgrounDRb. Do you agree? Do you have any idea to solve this?

Thanks,
Sergio.

On 4/4/07, Geoff Garside <ruby at geoffgarside.co.uk> wrote:
>
> Hi Sergio,
> Are you getting this error when you do something like
>
>         w = MiddleMan.worker(:worker_key)
>         w.do_work
>
> or when you actually call `MiddleMan.worker`? Usually its happened
> like this to me
>
>         key = MiddleMan.new_worker(:class => :my_worker)
>         -- Exception has been thrown here inside BackgrounDRb
>         w = MiddleMan.worker(key)
>         -- Get ERRNO exception here
>
> The exception thrown by the worker in BackgrounDRb is dumped out to
> log/backgroundrb.log. Because the worker crashes out my call to
> `worker` fails and raises an exception.
>
> Does that help?
>
> Geoff
>
> On 4 Apr 2007, at 14:15, Sergio Espeja wrote:
>
> > Hi Geoff, thanks for your reply!
> >
> > The exception in the worker occurs when I call a method of a remote
> > server object (DRbObject). Any idea?
> >
> > Thanks for your help!
> > Sergio.
> >
> > On 4/4/07, Geoff Garside<ruby at geoffgarside.co.uk> wrote:
> >> On 4 Apr 2007, at 12:47, Sergio Espeja wrote:
> >>
> >>> Hello,
> >>>
> >>> I am trying to make DRb calls to a external server from a
> >>> backgrounDRb worker, but I'm getting always the next exception
> >>> when I make the remote call.
> >>>> ERROR: drbunix:///tmp/backgroundrb.11175/
> >>>> experimenter_worker_3e899de945f0803a82cd257cfac316d0_0_0.0738904928
> >>>> 422051 - #<Errno::ENOENT: No such file or directory - ///tmp/
> >>>> backgroundrb.11175/
> >>>> experimenter_worker_3e899de945f0803a82cd257cfac316d0_0_0.0738904928
> >>>> 422051>
> >>>> 20070404-13:12:15 (11179) (druby://externalserver:43696) /usr/
> >>>> lib/ruby/1.8/drb/drb.rb:733:in `open'
> >>>
> >>> Doing the same DRb call from a script outside a backgrounDRb
> >>> worker works.
> >>>
> >>> I don't know what to do in order to fix this, any idea?
> >>>
> >>> Thanks a lot!
> >>> Sergio.
> >>> --
> >>> Sergio Espeja
> >>> http://spejman-on-rails.blogspot.com
> >>> http://spejman.blogspot.com
> >>> _______________________________________________
> >>> Backgroundrb-devel mailing list
> >>> Backgroundrb-devel at rubyforge.org
> >>> http://rubyforge.org/mailman/listinfo/backgroundrb-devel
> >>
> >> Its likely that something in your worker is raising an exception
> >> and the worker is crashing out. Check the backgroundrb and
> >> backgroundrb_server logs.
> >>
> >> Regards,
> >> Geoff
> > --
> > Sergio Espeja
> > http://spejman-on-rails.blogspot.com
> > http://spejman.blogspot.com
>
>
>
>
> --
Sergio Espeja
http://spejman-on-rails.blogspot.com
http://spejman.blogspot.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/backgroundrb-devel/attachments/20070404/aa4af0fb/attachment-0001.html 


More information about the Backgroundrb-devel mailing list