librelist archives

« back to archive

Exceptions not caught

Exceptions not caught

From:
Santtu Lintervo
Date:
2014-07-01 @ 06:55
Hi

For some reasons exceptions pass through sometimes from the worker loop 
without being caught and handled by failure backend. I'm using Resque 
version 1.25.2. Exceptions pass through from this line in perform method: 
https://github.com/resque/resque/blob/5379faa08db53233d7a1bbc4f1e01104be7d7851/lib/resque/worker.rb#L250.
Method call is wrapped in "rescue Object => e" but for some reason errors 
are not caught always.

Here's example stack trace:

Intercom::ServiceUnavailableError: Intercom::ServiceUnavailableError

ems/intercom-ruby-b43260aa1f9d/lib/intercom/request.rb:  86:in 
`raise_errors_on_failure'
…ems/intercom-ruby-b43260aa1f9d/lib/intercom/request.rb:  63:in `block in execute'
                       /usr/lib/ruby/1.9.1/net/http.rb: 746:in `start'
…ems/intercom-ruby-b43260aa1f9d/lib/intercom/request.rb:  61:in `execute'
…undler/gems/intercom-ruby-b43260aa1f9d/lib/intercom.rb:  66:in 
`send_request_to_path'
…undler/gems/intercom-ruby-b43260aa1f9d/lib/intercom.rb: 107:in `get'
…r/gems/intercom-ruby-b43260aa1f9d/lib/intercom/user.rb:  35:in `find'
…r/gems/intercom-ruby-b43260aa1f9d/lib/intercom/user.rb:  56:in `find_by_user_id'
…alLogger/releases/20140630134308/lib/intercom_utils.rb:  49:in 
`find_or_create_user'
…alLogger/releases/20140630134308/lib/intercom_utils.rb:  36:in 
`send_custom_data!'
…40630134308/app/workers/intercom_custom_data_worker.rb:   8:in `perform'
…d_gems/ruby/1.9.1/gems/resque-1.25.2/lib/resque/job.rb: 240:in `block (3 
levels) in perform'
…d_gems/ruby/1.9.1/gems/resque-1.25.2/lib/resque/job.rb: 239:in `block (2 
levels) in perform'
…d_gems/ruby/1.9.1/gems/resque-1.25.2/lib/resque/job.rb: 247:in `call'
…d_gems/ruby/1.9.1/gems/resque-1.25.2/lib/resque/job.rb: 247:in `perform'
…ems/ruby/1.9.1/gems/resque-1.25.2/lib/resque/worker.rb: 250:in `perform'

Any clue what could be causing this?

Re: [resque] Exceptions not caught

From:
David Copeland
Date:
2014-07-01 @ 11:57
If there's an exception when trying to handle the failure, the job could
end up being lost.  Do you have any lifecycle hooks set up?  Also, do you
see any other exceptions in your log?  You may need to set VVERBOSE=1 on
your worker to see complete log messages.

Dave


On Tue, Jul 1, 2014 at 2:55 AM, Santtu Lintervo <santervo@gmail.com> wrote:

> Hi
>
> For some reasons exceptions pass through sometimes from the worker loop
> without being caught and handled by failure backend. I'm using Resque
> version 1.25.2. Exceptions pass through from this line in perform method:
> 
https://github.com/resque/resque/blob/5379faa08db53233d7a1bbc4f1e01104be7d7851/lib/resque/worker.rb#L250.
> Method call is wrapped in "rescue Object => e" but for some reason errors
> are not caught always.
>
> Here's example stack trace:
>
> Intercom::ServiceUnavailableError: Intercom::ServiceUnavailableError
>
> ems/intercom-ruby-b43260aa1f9d/lib/intercom/request.rb:  86:in
> `raise_errors_on_failure'
> …ems/intercom-ruby-b43260aa1f9d/lib/intercom/request.rb:  63:in `block in
> execute'
>                        /usr/lib/ruby/1.9.1/net/http.rb: 746:in `start'
> …ems/intercom-ruby-b43260aa1f9d/lib/intercom/request.rb:  61:in `execute'
> …undler/gems/intercom-ruby-b43260aa1f9d/lib/intercom.rb:  66:in
> `send_request_to_path'
> …undler/gems/intercom-ruby-b43260aa1f9d/lib/intercom.rb: 107:in `get'
> …r/gems/intercom-ruby-b43260aa1f9d/lib/intercom/user.rb:  35:in `find'
> …r/gems/intercom-ruby-b43260aa1f9d/lib/intercom/user.rb:  56:in
> `find_by_user_id'
> …alLogger/releases/20140630134308/lib/intercom_utils.rb:  49:in
> `find_or_create_user'
> …alLogger/releases/20140630134308/lib/intercom_utils.rb:  36:in
> `send_custom_data!'
> …40630134308/app/workers/intercom_custom_data_worker. rb:   8:in `perform'
> …d_gems/ruby/1.9.1/gems/resque-1.25.2/lib/resque/job.rb: 240:in `block (3
> levels) in perform'
> …d_gems/ruby/1.9.1/gems/resque-1.25.2/lib/resque/job.rb: 239:in `block (2
> levels) in perform'
> …d_gems/ruby/1.9.1/gems/resque-1.25.2/lib/resque/job.rb: 247:in `call'
> …d_gems/ruby/1.9.1/gems/resque-1.25.2/lib/resque/job.rb: 247:in `perform'
> …ems/ruby/1.9.1/gems/resque-1.25.2/lib/resque/worker.rb: 250:in `perform'
>
> Any clue what could be causing this?
>



-- 
*Dave Copeland, Lead Engineer (Eastern Time)*
dave@stitchfix.com