summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* Upgrade to GitHub-native Dependabot (#1454)dependabot-preview[bot]2021-05-071-0/+7
| | | Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
* Replace enum function with internal Enum class (#1459)MyrikLD2021-05-0714-58/+50
| | | | | | | * Removed deprecated (object) inheritance Add new py38,py39 versions to tox, removed deprecated py27,py34 Replace enum internal function with Enum class * fix
* bugfix: Allow using staticmethods as jobs (#1458)pwws2021-05-074-4/+46
|
* Cleanup zombie worker leftovers as part of StartedJobRegistry's cleanup() ↵Omer Lachish2021-04-204-42/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (#1372) * cleanup jobs that are not really running due to zombie workers * remove registry entries for zombie jobs * return only the job ids on cleanup * test zombie job cleanup * format code * rename variable to explain that second element in tuple is expiry, not score * remove worker_key * detect zombie jobs using old heartbeats * reuse get_expired_job_ids * set score using current_timestamp * test idle jobs using stale heartbeats * extract timeout into variable * move heartbeats into StartedJobRegistry * use registry.heartbeat in tests * remove heartbeats when job removed from StartedJobRegistry * remove idle and expired jobs from both wip and heartbeats set * send heartbeat_ttl to registry.add * typo * revert everything 😶 * only keep job heartbeats as score (and get rid of job timeouts as scores * calculate heartbeat_ttl in an overrideable function + override it in SimpleWorker + move storing StartedJobRegistry scores to job.heartbeat() * set heartbeat to monitoring interval for infinite timeouts * track elapsed_execution_time as part of worker * reset current job working time when work on a job is done * persisting the job working time as part of monitoring
* Changed docker CMD to ENTRYPOINT (#1449)rpkak2021-04-201-1/+1
| | | fix #1448
* Fix mistake in doc of Random dequeuing strategy (#1443)Antonino Sabetta2021-04-201-1/+1
|
* prevent job exception being logged twice (#1440)PetreM2021-04-201-1/+1
|
* Newer pip install command from git (#1439)James Cobb2021-04-012-2/+2
| | | | | | | * Newer pip install command from git Updated cutting edge pip install command to use HTTPS rather than insecure git+git protocol, as recommended by pip documentation. This allows the command to work with pip >= 21.0.1 * Updated pip command in README
* Bump version to 1.8.0v1.8.0Selwin Ong2021-03-312-1/+11
|
* Workers dequeuing jobs from queues using both Round-Robin and Random ↵Biel Cardona2021-03-313-2/+97
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | strategies (#1425) * implemented round-robin and random access to queues * added tests for RoundRobinQueue * reverted change in gitignore * removed linebreak * added tests for random queues * added documentation for round robin and random queues * moved round robin strategy to worker * reverted changes to queue.py * reverted changes to workers.md * reverted changes to test_queue * added tests for RoundRobinWorker and RandomWorker * added doc for round robin and random workers * removed f-strings for backward compatibility * corrected a mistake * minor changes (code style) * now using _ordered_queues instead of queues for reordering queues
* bugfix: Add self.serializer when calling self.fetch_many in ↵Jahn Thomas Fidje2021-02-241-1/+1
| | | | | Job.fetch_dependencies (#1411) Co-authored-by: Jahn Thomas Fidje <jahn-thomas.fidje@telenor.com>
* Add a "stopped" JobStatus and the machinery to properly handle it (#1394)Daniel Alley2021-02-095-25/+54
| | | | | | | * Add a "stopped" JobStatus and the machinery to properly handle it fixes #1389 * Apply requested changes
* Add runner for asyncio tasks (#1405)MyrikLD2021-02-033-1/+27
| | | | | | | | | * add asyncio runner * add asyncio runner * fix for old version * fix tests
* Multidependencies (#1397)skieffer2021-02-024-13/+195
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Also accept lists and tuples as value of `depends_on`. * The elements of the lists/tuples may be either Jobs or Job IDs. * A single Job / Job ID is still accepted as well. * Represent _all_ job dependencies in `Job.to_dict()`. We now represent the entire list, instead of just the first element. * Fix some doctext regarding plurality of dependencies. * Add unit tests for job dependencies. * One unit test establishes a pattern for checking execution order as affected by dependencies. * Another unit test applies this pattern to the new capability to name multiple dependencies. * Add unit test for new `depends_on` input formats. Also test that these are properly persisted. * Repair `Job.restore()`. Need to convert bytes back to strings when reloading `dependency_ids`. * Maintain backwards compat. in `Job.to_dict()`. Keep the old `dependency_id` (singular) key. * Provide coverage for new test fixture. * Simplify some code. Cut some superfluous `as_text()` calls left over from an earlier commit. * Check for `dependency_id` in `Job.restore()` for backwd. compat. Also eliminate use of `as_text()` here, in favor of `.decode()`. * Switch to snake case instead of camel case. * Eliminate some usages of `as_text()`. Also cut some `print` statements. * Cleanup. * Accept arbitrary iterables for `Job`'s `depends_on` kwarg. Instead of requiring a list or tuple, we now make use of `ensure_list()`. * Add test fixtures. * Provide a system to get two workers working simultaneously, using `multiprocessing`. * Define a simple job that just says whether its dependencies are met. * In `rpush`, make an option to record the name of the worker. * Improve unit tests on execution order with dependencies. These now actually have two workers going, which makes a more thorough test. * Add unit test examining `Job.dependencies_are_met()` at execution time. * Redesign dependency execution order unit tests. * Simplify assertions. * Improve doctext and formatting. * Move fixture tests to new, dedicated module `test_fixtures.py`. * Use `enqueue` instead of `enqueue_call` in new unit tests.
* Change back `path` connection keyword argument to `unix_socket_path` (#1403)Jochen Kupperschmidt2021-01-261-1/+11
| | | | | | | | | | | | | | | | | If a UNIX socket path is passed to the constructor of the Redis client, `redis.client.Redis`, the value of keyword argument `unix_socket_path` is passed to the constructor of `UnixDomainSocketConnection` with the key `path`. When RQ's scheduler creates its own Redis connection, it instantiates class `redis.client.Redis` with keyword arguments obtained from the connection pool. If the pooled connection is a `UnixDomainSocketConnection`, its keyword arguments contain `path`, as given on instantiation. This results in a `TypeError: __init__() got an unexpected keyword argument 'path'`. This change renames the key back to `unix_socket_path` before the keyword arguments dictionary is used to instantiate `redis.client.Redis`.
* Document that --serializer CLI argument is only available in 1.8.0Selwin Ong2021-01-191-4/+2
|
* Added --serializer option to cli, finishing off PR #1381 and fix #1357 (#1395)f0cker2021-01-193-10/+29
| | | | | | | | | | | * Added --serializer option to cli, finishing off PR #1381 and fix #1357 * Update documentation * Update documentation * Modified help message Co-authored-by: f0cker <dturner@trustwave.com>
* Add exception to catch redis connection failure to retry after wait time (#1387)Adda Satya Ram2021-01-142-8/+34
| | | | | | | | | | | | | | | | | * add exception catch for redis connection failure * Add test for connection recovery * add exponential backoff * limit worker max connection wait time to 60 seconds * fix undefined class variable * fix string formatting issue while printing error log * cap max connection wait time:better code style Co-authored-by: corynezin <cory.nezin@gmail.com>
* clean_worker_registry cleans in batches to prevent submitting too muc… (#1390)AxeOfMen2021-01-094-5/+74
| | | | | | | | | | | * clean_worker_registry cleans in batches to prevent submitting too much data to redis at once when there are a large number of invalid keys * Address code review comments Rename MAX_REMOVABLE_KEYS to MAX_KEYS * Fix tests Co-authored-by: Joel Harris <combolations@gmail.com>
* Bump version to 1.7.0v1.7.0Selwin Ong2020-11-293-2/+8
|
* Improve docsSelwin Ong2020-11-282-35/+76
|
* Fix custom serializer in job fetches (#1381)JackBoreczky2020-11-285-11/+41
| | | | | | | | | * Ensure that the custom serializer defined is passed into the job fetch calls * add serializer as argument to fetch_many and dequeue_any methods * add worker test for custom serializer * move json serializer to serializers.py
* Add `job.refresh()` to docs (#1384)C. Mangla2020-11-281-0/+1
|
* Add link to Github Actions badge in READMESelwin Ong2020-11-271-1/+1
|
* Fix RQScheduler when run with SSL connection (#1383)BobReid2020-11-277-28/+152
| | | | | | | | | | | * Quick and dirty set up of SSL * copy connection kwargs in scheduler * fix * chmod the cert * Skip SSL tests in CI
* fix snippet link in docs (#1380)Kyle Verhoog2020-11-212-2/+2
| | | | | The former link is broken since http://flask.pocoo.org/snippets has been taken down. See https://github.com/pallets/website/issues/41 for more info.
* fixed typo in send_kill_horse_command() example (#1378)Arturo Bracero2020-11-181-1/+1
|
* send_stop_job_command (#1376)Selwin Ong2020-11-145-22/+132
| | | | | | | | | * Added send_stop_job_command(). * send_stop_job_command now accepts just connection and job_id * Document send_job_job_command * Updated test coverage
* Added job.worker_name (#1375)Selwin Ong2020-11-0812-168/+122
| | | | | | | | | | | * Added job.worker_name * Fix compatibility with Redis server 3.x * Document job.worker_name * Removed some Python 2 compatibility stuff. * Remove unused codes
* Bump version to 1.6.1v1.6.1Selwin Ong2020-11-082-2/+4
|
* Merge branch 'master' of github.com:rq/rqSelwin Ong2020-11-083-2/+8
|\
| * Release scheduler lock when running in burst mode (#1374)Selwin Ong2020-11-083-2/+8
| | | | | | | | | | * Fixed an issue where scheduler lock is not release when running worker in burst mode * Remove unused import
* | Bump to version 1.6.0v1.6.0Selwin Ong2020-11-082-1/+10
|/
* Redis does not accept `parser_class` argument (#1373)Selwin Ong2020-11-071-0/+3
|
* Propagate logging settings from worker to scheduler (#1366)Chris de Graaf2020-10-312-21/+26
|
* tests: updated github worklow for tests to use requirements.txt and d… (#1364)Ruslan Mullakhmetov2020-10-262-2/+4
| | | | | | | * tests: updated github worklow for tests to use requirements.txt and dev-requirements.txt * build: updated dev-requirements.txt Co-authored-by: Ruslan Mullakhmetov <ruslan@twentythree.net>
* feat: added job heartbeat to track whether job is actually executing (#1349)Ruslan Mullakhmetov2020-10-264-4/+26
| | | | | | | | | | | | | | | | | | | | | | | * feat: added job heartbeat to track whether job is actually executing heartbeat might be needed in cases when worker was hardkilled or the whole VM/docker was forcibly rebooted. * fixed tests * fixed test coverage issue * chore: renamed job.heartbeat stuff according to review feedback * chore: pipelined worker heartbeat and job heartbeat * docs: documented job.heartbeat property * fixes after review * docs: updated last_heartbeat description * chore: review Co-authored-by: Ruslan Mullakhmetov <ruslan@twentythree.net>
* Workers can listen to external commands via pubsub (#1363)Selwin Ong2020-10-224-5/+157
| | | | | | | | | | | * Added a way to send shutdown command via pubsub * Added kill-horse command * Added kill horse command * Added send_kill_horse_command() and send_shutdown_command() * Document worker commands
* tests: added ability to run tests in Docker (#1361)Ruslan Mullakhmetov2020-10-223-1/+16
| | | | | | | | | | | | | * tests: added ability to run tests in Docker useful to run full test suit on Mac * tests: minor improvement in dockerfile for tests * tests: typo in Dockerfile * tests: updated dev requirements Co-authored-by: Ruslan Mullakhmetov <ruslan@twentythree.net>
* Remove alpha warning from scheduler docsSelwin Ong2020-10-201-2/+5
|
* Increase scheduler lock TTL to 60 (#1362)Selwin Ong2020-10-201-1/+1
|
* scheduler: now operates with chunks of jobs (#1355)Nikita Romaniuk2020-10-203-11/+24
| | | | | | | | | | | | | * scheduler: now operates with chunks of jobs * scheduler: set default chunk_size for ScheduledJobRegistry.get_jobs_to_schedule * scheduler: fixed missing indent * scheduler: added test for get_jobs_to_schedule() with chunk_size parameter * scheduler: fixed test for passing python 3.5 (no f-strings) * scheduler: fixed chunk_size in test make it lighter to run
* feat: avoided "zombie" processes after killing work horse (#1348)Ruslan Mullakhmetov2020-10-205-9/+30
| | | | | | | | | | | * feat: avoided "zombie" processes after killing work horse by setting work horse process group and killing this group * fixed tests * tests: added test to check that all workhorse subprocesses are killed * tests: updated guthub run tests dependencies since they are not using (dev-)requirements.txt Co-authored-by: Ruslan Mullakhmetov <ruslan@twentythree.net>
* Fix #1340 (#1341)Orkhan2020-09-281-0/+5
| | | | | | | * docker folder along with Dockerfile has been added * fix #1340 Co-authored-by: orkhan.mamedov <orkhan.mamedov@sravni.ru>
* Add entry ssl_ca_certs in worker config settings (#1347)Qiming Sun2020-09-281-0/+1
|
* pass retry param to enqueue_at func (#1343)Vladimir Ulupov2020-09-282-2/+11
|
* Exclude tests directory from wheel buildsSelwin Ong2020-09-101-1/+1
|
* Bump version to 1.5.2v1.5.2Selwin Ong2020-09-102-2/+7
|
* Fixes an issue where retried jobs should not be put in FailedJobRegistry (#1336)Selwin Ong2020-09-102-1/+6
|
* include requirements.txt in sdist (#1335)Evgeni Golov2020-09-101-0/+1
| | | Fixes: #1328