Selwin Ong
544f2e6fb2
Fixed result logging call .
9 years ago
Selwin Ong
2140cc4fab
Job result should be converted to text before being logged.
9 years ago
Toms Bauģis
5a4f297134
do not truncate result output as that can be done in the log formatter
9 years ago
Michael Keirnan
bad054989d
export worker id and job id to env of work horse
...
For tracing job execution in a distributed system it is useful to tag log
entries with the worker id and job id. The current job is accessible
via get_current_job(), but that requires an extra redis connection. And
the current worker id (the worker id of the parent process) does not appear
to be available.
Rather than introducing an `rqworker` alternative or subclassing Worker, it
feels simple and efficient to make these contextual ids available as
environment variables. This should have no performance cost and no
API compatibility issues.
Some useful things to do with these values in the worker horse process:
+ include them in log messages
+ include them as 'x-' headers in HTTP requests made by workers
9 years ago
Toms Bauģis
ade154575e
fix travis error - python 2.6 or whatevs wants positions spelled out for .format
9 years ago
Toms Bauģis
682d4adb40
log result in DEBUG level and truncate to 2k symbols
9 years ago
Selwin Ong
cf20f1d9b2
Merge pull request #576 from jlopex/ensure_custom_handlers_are_called
...
Ensure custom exception handlers call when Redis is down
9 years ago
Vincent Driessen
c1a4780d10
Fix PEP8 complaints
9 years ago
Javier Lopez
4fb59a4ceb
Ensure custom exception handlers calls when Redis is down
9 years ago
Selwin Ong
e6a499ada8
Merge pull request #561 from selwin/async-bug
...
Sync jobs should be cleaned up after execution.
10 years ago
Selwin Ong
edd139d86f
Sync jobs should be cleaned up after execution.
10 years ago
Selwin Ong
cdcea84105
Merge pull request #557 from selwin/exception_handling
...
Exception handling
10 years ago
Selwin Ong
3c3646cf91
Merge branch 'master' into exception_handling
...
Conflicts:
tests/fixtures.py
10 years ago
mozillazg
7198b4568a
Fixed a format error
10 years ago
Vincent Driessen
0de225ec62
Emphasize private nature of `stopped` property
10 years ago
Vincent Driessen
ec0e04727b
Rename `maintenance_date` -> `last_cleaned_at`
10 years ago
Vincent Driessen
891be55b87
Clean up Worker.__init__ logic a little
10 years ago
Vincent Driessen
4d0ae5da98
Clean up type checking of Worker constructor
10 years ago
Vincent Driessen
94258761ae
Make string formatting consistent
10 years ago
Selwin Ong
f370f79819
Merge pull request #534 from selwin/registry-maintenance
...
Worker automatically cleans job registries every hour
10 years ago
Selwin Ong
c3767e28e2
Worker now runs maintenance tasks every hour and on startup.
10 years ago
Selwin Ong
5782ac10c4
Added worker.clean_registries().
10 years ago
RyanMTB
9a00b0eca6
Updated Worker API
10 years ago
Selwin Ong
d51f0200d7
Merge pull request #513 from trevorprater/master
...
Improving logging.
10 years ago
Cosmin Stefan
260f7caf66
Enable proper setup of signale handlers for SimpleWorker as well. fixes #523
...
This allows a SIGTERM to make the worker perform a warm shutdown and cleanly break out of the loop and finish the current job, if any.
10 years ago
Trevor Prater
5674edad61
Changed rqworker shutdown message.
...
- As requested by @nvie and @selwin.
10 years ago
Trevor Prater
fd1dca40b9
Improving logging.
...
- Include worker key in worker startup log statement.
- Added a notification to make it more clear when a 'burst' worker dies.
10 years ago
Vincent Driessen
5cb873b438
Fix PEP8 complaint.
10 years ago
Mark LaPerriere
636a537fa7
updates addressing @selwin comments for PR #465
10 years ago
Bradley Young
04e403e1a3
dread comma, I adjure thee.
10 years ago
Bradley Young
d56b5424c8
merging master and fixing conflicts
10 years ago
Bradley Young
c428f955e4
per @selwin, adding a deprecated handler for exc_handler
10 years ago
Mark LaPerriere
a4ca4704ac
convert redis returned bytes into text/string
10 years ago
Mark LaPerriere
cfe3da287a
updated branch to latest
10 years ago
Vincent Driessen
b8d425b318
Various PEP8 fixes.
10 years ago
Vincent Driessen
fac2b10309
Auto-sort imports using isort.
10 years ago
Bradley Young
f05d77b92b
changing "default" for exception_handlers to None; same exact logic can be implemented, but cleaner
10 years ago
Bradley Young
d3e4fb567b
merge && updates to add multiple exception handlers.
10 years ago
Bradley Young
f575137612
updating worker to have exception_handlers
10 years ago
Vincent Driessen
dc5cd514ee
Explicitly cast map() result to a list, for Python 3 compat.
10 years ago
Selwin Ong
dc09676ee0
Minor copywriting fixes.
10 years ago
Selwin Ong
01ab2f20dd
Minor copywriting fixes.
10 years ago
Vincent Driessen
543bcbc60b
Explicitly cast map() result to a list, for Python 3 compat.
10 years ago
Selwin Ong
eae2c40ea0
Merge pull request #457 from jlopex/block_until_horse_finishes
...
Make parent worker process wait until horse process finishes
10 years ago
Mark LaPerriere
e6c32edad9
add birth_date and death_date properties to Worker
10 years ago
Jonathan Tushman
1ae5a12a81
merging master
10 years ago
Vincent Driessen
cd0c3c9c1e
Merge pull request #462 from conslo/worker-hash
...
Worker hash
10 years ago
Jonathan Tushman
82333d2ad5
triggering shutdown by setting a redis flag
10 years ago
Travis Johnson
0ad4cb3410
comments
10 years ago
Travis Johnson
c301369c2e
implement __eq__ and __hash__ for workers
10 years ago
Javier Lopez
fc5295edfc
Set busy state on parent while waiting for horse
10 years ago
glaslos
55c541bc59
added job ttl to queue.enqueue()
10 years ago
Bradley Young
5caccaabfe
Adding optional list handling to the exc_handler option in Worker.
...
Adding command line --exception_handler option (with multiple entries allowed) to `rq worker`
Added tests for command line options.
10 years ago
Nic Cope
de0b501823
Pass the default worker connection into the started and finished registries
...
In practice all the registry methods are called with pipelines, but if no
connection is passed in when instantiating the registry and the connection
stack is empty resolve_connection will raise NoRedisConnectionException.
10 years ago
Selwin Ong
2307bc8253
Added FinishedJobRegistry to monitor finished jobs.
10 years ago
Vincent Driessen
783b6f9ec7
Fix PEP8 complaint.
10 years ago
Vincent Driessen
7686785d61
Merge branch 'selwin-working-queue'
...
Conflicts:
tests/test_worker.py
10 years ago
Vincent Driessen
4b7c59d68d
Fix PEP8 complaints.
10 years ago
Selwin Ong
9341a4a33d
Renamed WorkingQueue to StartedJobRegistry.
10 years ago
Selwin Ong
60c7a3cc6e
working_queue.remove call should be pipelined.
10 years ago
Selwin Ong
4d90cc062e
Add job to WorkingQueue before execution and remove from WorkingQueue after.
10 years ago
Selwin Ong
b0c0a84ab0
Moved some logic into worker.prepare_job_execution to make things testable.
10 years ago
foxx
52c3ad0fbf
Renamed to SimpleWorker
10 years ago
foxx
16ee71f26d
Use class for test worker, and performs PID check in unit tests, #412
10 years ago
Selwin Ong
7cf8ef42d1
Don't pass "args" into logging call.
10 years ago
Selwin Ong
b05c2052e1
Capture more data when logging errors.
11 years ago
Vincent Driessen
865efd6e8c
Leave setting the state to the worker, not the Job itself.
...
Should fix #389 .
11 years ago
Vincent Driessen
d37f49f643
Merge branch 'andrewsg-warnings'
11 years ago
Selwin Ong
7ac1c3500a
Worker.__init__ should accept custom job class.
11 years ago
Andrew Gorcester
17a4ed056d
use warnings.warn() instead of raise for DeprecationWarning
11 years ago
Vincent Driessen
83382f51d0
PEP8ify.
11 years ago
Vincent Driessen
c263f8f600
Fix regression introduced in 0.4.3.
11 years ago
Vincent Driessen
b048e23875
Merge pull request #342 from friedcell/master
...
make job class dynamic
11 years ago
Vincent Driessen
ab9e6b852e
Fix PEP8 complaints.
11 years ago
Vincent Driessen
38ec259b6e
Enable the most modern Python syntax.
11 years ago
Marko Mrdjenovic
5cba260cca
Job and Queue classes as variables (compatible with existing naming)
11 years ago
Tomas Hanacek
6494233058
rqworker default arguments of socket, worker_ttl, results_ttl bugfix
11 years ago
Selwin Ong
7eb6c2ab9f
Job timeouts are now handled by "worker.death_penalty_class".
11 years ago
Selwin Ong
835c353380
Job status should be updated during job.perform().
11 years ago
Selwin Ong
57990fa052
Simplify worker.work() by moving some functionalities to relevant methods.
11 years ago
Selwin Ong
f5c3c9a6dd
Deprecate job.status.
11 years ago
Selwin Ong
72457d2286
Added DeprecationWarning to worker.state.
11 years ago
Selwin Ong
2fe5d9e25e
Python 3 compatibility with worker.get_current_job().
11 years ago
Selwin Ong
802ecb5ccb
Renamed worker.set_job_id() and worker.get_job_id() for consistency.
11 years ago
Selwin Ong
93bb9ec5f4
Added tests for worker.get_current_job().
11 years ago
Selwin Ong
1b3832adb5
Merge branch 'master' of https://github.com/mbr/rq into worker-get_job_id
...
Conflicts:
rq/worker.py
11 years ago
Selwin Ong
37376cfe42
Deprecate worker.state.
11 years ago
Selwin Ong
2044e790f5
Renamed Worker.fork_and_perform_job to Worker.execute_job.
11 years ago
Marc Brinkmann
e81ee5b672
Update worker.py
...
Use docstring instead of comment. Sorry.
11 years ago
Vincent Driessen
d0381e98ee
Fix .pipeline -> ._pipeline.
...
This makes sure it's compatible with both Redis and StrictRedis back
ends.
11 years ago
Dj Gilcrease
fd036538f7
Wrap the perform_job try/except in a pipeline context so the pipeline connection is properly refrshed after the work is done
11 years ago
Malthe Borch
ba0b39a43b
Unpickle job data lazily. This fixes issue #294 .
11 years ago
Vincent Driessen
888d771d4d
Merge pull request #287 from malthe/shed-times-dependency
...
Remove dependency on 'times' library (issue #286 ).
11 years ago
Vincent Driessen
e1e2405150
Merge branch 'hotfix-0.3.13'
...
Conflicts:
CHANGES.md
11 years ago
Vincent Driessen
b52089ede1
Fix NameError.
...
This was the result of a faulty merge. I'm sorry.
11 years ago
Vincent Driessen
cf98591ca5
Merge branch 'hotfix-0.3.12'
...
Conflicts:
CHANGES.md
rq/worker.py
11 years ago
Vincent Driessen
d0fa35dc66
Python 2.6 fix.
11 years ago
Vincent Driessen
8414a67d65
Fix bug where worker died from monitoring views.
...
Fixes #288 .
Conflicts:
rq/worker.py
11 years ago
Malthe Borch
c5a381fbe9
Remove dependency on 'times' library (see issue #286 ).
...
Basically, for the functionality needed, a dependency on 'times' (which
in turn depends on 'python-dateutil') seem unnecessary.
11 years ago
Vincent Driessen
9abbfc4dfb
Use kwarg to specify connection.
11 years ago