Skip to content

Commit

Permalink
Merge pull request #593 from taiki45/no-system-stack-error
Browse files Browse the repository at this point in the history
No SystemStackError with any active jobs
  • Loading branch information
kyrylo committed Aug 23, 2016
2 parents d1a3642 + eeb0891 commit 605b206
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/airbrake/rails/active_job.rb
Expand Up @@ -16,7 +16,7 @@ module ActiveJob
notice[:context][:component] = 'active_job'
notice[:context][:action] = self.class.name

notice[:params] = as_json
notice[:params] = serialize

# We special case Resque because it kills our workers by forking, so
# we use synchronous delivery instead.
Expand Down
7 changes: 7 additions & 0 deletions spec/apps/rails/dummy_app.rb
Expand Up @@ -58,7 +58,14 @@ def raise_error_after_rollback
class BingoJob < ActiveJob::Base
queue_as :bingo

class BingoWrapper
def initialize(bingo)
@bingo = bingo
end
end

def perform(*_args)
@wrapper = BingoWrapper.new(self)
raise AirbrakeTestError, 'active_job error'
end
end
Expand Down
10 changes: 10 additions & 0 deletions spec/integration/rails/rails_spec.rb
Expand Up @@ -112,6 +112,16 @@
).to have_been_made.at_least_once
end

it "does not raise SystemStackError" do
get '/active_job'
sleep 2

wait_for(
a_request(:post, endpoint).
with(body: /"type":"SystemStackError"/)
).not_to have_been_made
end

context "when Airbrake is not configured" do
it "doesn't report errors" do
allow(Airbrake).to receive(:build_notice).and_return(nil)
Expand Down

0 comments on commit 605b206

Please sign in to comment.