What have you found for these years?

2010-08-25

what's the RestGraph::Error in newrelic_rpm?

So, after looking at rails code and newrelic_rpm code,
I think this is a false alarm, that newrelic_rpm reports it
before this exception gets rescued.
There's no error in get exceptional at all. (thus more accurate)

The flow looks like: (not related methods are omitted)
(alias_method_chain is so good at creating spaghetti)

1. perform_action_with_newrelic_trace (from newrelic_rpm alias_method_chain)
2. perform_action_without_newrelic_trace (it's aliased to
perform_action_with_rescue from rails)
3. perform_action_without_rescue (it's aliased to perform_action from rails)
4. running our application codes (i.e. filters -> action -> view)
5. RestGraph::Error raised somewhere
6. newrelic_rpm rescued it, calling frame_data.notice_error(e) to send
error report
7. newrelic_rpm re-raise the error
8. perform_action_with_rescue rescues the error with rescue_from! so
it's actually not an issue
9. action halt.
10. user gets redirected.

That is, there's no error 500 at all.

newrelic_rpm -v 2.12.3:

begin
  NewRelic::Agent::BusyCalculator.dispatcher_start frame_data.start
  if block_given?
    yield
  else
    perform_action_without_newrelic_trace(*args)
  end
rescue Exception => e
  frame_data.notice_error(e)
  raise
end
rails -v 2.3.5:
def perform_action_with_rescue #:nodoc:
  perform_action_without_rescue
rescue Exception => exception
  rescue_action(exception)
end

0 retries:

Post a Comment

All texts are licensed under CC Attribution 3.0