You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Vincent Driessen 90b15fd0b6 Don't silently fail when unpickling.
When a pickled job string can't be unpickled because some required
module isn't loadable, this leads to an `UnpickleError` in the worker
(not in the horse).

Currently we just assume "garbage" in the job's data field, and silently
ignore it.

This is bad.

Really bad.

Because it avoids the normal exception handling mechanism that RQ has.

Historically, this "feature" was introduced to ignore any invalid pickle
data ("bad strings") on queues, and go on. However, we must assume data
inside `job.data` to be valid pickle data.

While an invalid _format_ of pickle data (e.g. the string "blablah"
isn't valid) leads to unpickle errors, unpickling errors will also occur
when the job can't be validly constructed in memory for other reasons,
like being unable to load a specific class.

Django is a good example of this: try submitting jobs that use
`django.conf.settings` while the `DJANGO_SETTINGS_MODULE` env var isn't
set. Currently, RQ workers will drop these jobs and dismiss them like
any non-valid pickle data. You won't be notified.

This patch changes RQ's behaviour to never ignore invalid string data on
any queue and _always_ handle these errors explicitly (but without
bringing the main loop down, of course).
13 years ago
..
contrib Also report job description. 13 years ago
scripts Switched config file loading to import lib to allow dotted "paths" to settings modules 13 years ago
__init__.py Implement the get_current_job() function. 13 years ago
compat.py Use the true Python 2.7 stdlib implementation instead. 13 years ago
connections.py Resolve connections early. 13 years ago
decorators.py Rename the const. 13 years ago
dummy.py Clean up some of the dummy jobs used for testing. 14 years ago
exceptions.py Implement requeue() method on FailedQueue. 14 years ago
job.py Don't silently fail when unpickling. 13 years ago
local.py Fix AttributeError. 13 years ago
queue.py Don't silently fail when unpickling. 13 years ago
timeouts.py Fix typo. 13 years ago
utils.py Ugh. Syntax. 13 years ago
version.py Bump version number. 13 years ago
worker.py Don't silently fail when unpickling. 13 years ago