Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: resque/resque
...
head fork: kemper/resque
compare: master
Checking mergeability… Don't worry, you can still create the pull request.
  • 1 commit
  • 3 files changed
  • 0 commit comments
  • 1 contributor
Commits on Dec 04, 2010
@kemper kemper fixed a defect where exceptions in the failure backend would cause th…
…e chile process to terminate like the parent
114a4e9
View
6 lib/resque/worker.rb
@@ -157,7 +157,11 @@ def perform(job)
job.perform
rescue Object => e
log "#{job.inspect} failed: #{e.inspect}"
- job.fail(e)
+ begin
+ job.fail(e)
+ rescue Object => e
+ log "Received exception when reporting failure: #{e.inspect}"
+ end
failed!
else
log "done: #{job.inspect}"
View
14 test/test_helper.rb
@@ -114,3 +114,17 @@ def self.perform
raise SyntaxError, "Extra Bad job!"
end
end
+
+class BadFailureBackend < Resque::Failure::Base
+ def save
+ raise Exception.new("Failure backend error")
+ end
+end
+
+def with_failure_backend(failure_backend, &block)
+ previous_backend = Resque::Failure.backend
+ Resque::Failure.backend = failure_backend
+ yield block
+ensure
+ Resque::Failure.backend = previous_backend
+end
View
7 test/worker_test.rb
@@ -25,6 +25,13 @@
assert_equal('Extra Bad job!', Resque::Failure.all['error'])
end
+ test "does not allow exceptions from failure backend to escape" do
+ job = Resque::Job.new(:jobs, {})
+ with_failure_backend BadFailureBackend do
+ @worker.perform job
+ end
+ end
+
test "fails uncompleted jobs on exit" do
job = Resque::Job.new(:jobs, [GoodJob, "blah"])
@worker.working_on(job)

No commit comments for this range

Something went wrong with that request. Please try again.