Commit Graph
484 Commits
Author SHA1 Message Date
Ilan Steemers 16fa6fa8d9 Fixes deprecated arrow syntax 2019-08-10 14:03:03 +02:00
Janne Rönkkö bca22054df Fix concurrency issue in timeout timer value processing
According to multiprocessing documentation for Value
(https://docs.python.org/3/library/multiprocessing.html#multiprocessing.Value)
reads and writes are protected with lock when the lock argument is True
(the default) or the lock argument is an instance of Lock or RLock. The
documentation states that operations like += are not atomic as that
involves reading and writing.

On the worker side the critical section includes also storing finished task
result because the timeout could happen after the task function has
finished but before the result has been stored and timer.value has been
updated to tell the guard process that the task has been finished.

On the guard side the critical section includes all checks done to see
if the worker has timed out or died and the actual reincarnation function
because the worker could update timer value to -1 (idle) or -2 (recycle)
after the guard has seen timer value 0 (timeout) and is going to terminate
the worker.
2019-01-28 08:39:56 +02:00
Ilan Steemers 44d963b716 Merge pull request #327 from mattaw/master
Modified django_q imports to support Python 3.4 again in cluster.py. …
2019-01-27 18:34:30 +01:00
Janne Rönkkö 0e2df88d92 Fix async_task timeout parameter handling when cluster timeout is set to None (the default)
The cluster timeout configuration default value None is documented to mean
tasks never timeout out. Also the documentation states that the timeout
can be overridden for individual tasks.

With the old implementation the timeout parameter given to async_task was
not honored if the cluster timeout was set to None.

Fixes: #335
2019-01-27 19:09:22 +02:00
Janne Rönkkö 2650659da9 Allow timeout unit tests to fail properly
The old implementation used count_forever test task that never finishes.
If the timeout implementation does not work in the test, the test never
end and you was required to kill the test runner.
2019-01-27 15:35:17 +02:00
Janne Rönkkö d09e2658be Add test for task finishes before timeout 2019-01-27 15:35:17 +02:00
Janne Rönkkö 888324cf48 Reduce code duplication in timeout unit tests 2019-01-26 20:44:31 +02:00
Matthew Swabey e84be5f33b Modified django_q imports to support Python 3.4 again in cluster.py. Closes #315 2018-12-09 12:28:04 -05:00
Ilan Steemers e68cf52515 Updates version 2018-08-29 19:03:53 +02:00
Ilan Steemers 2ec6994545 Merge pull request #312 from tboulogne/master
Add locale directory with fr translation
2018-08-15 20:02:23 +02:00
Ilan Steemers 4076795dc3 truncate error description in admin
Also removes old conditional imports
2018-08-13 18:50:35 +02:00
Ilan Steemers b5a01a9e93 Removes old rollbar support - relies on the pluggable error reporters now 2018-08-10 13:03:58 +02:00
Thierry BOULOGNE e083288af8 cleaning 2018-08-05 19:23:32 +02:00
Thierry BOULOGNE dfe60151a1 debug PO 2018-08-05 19:16:15 +02:00
Thierry BOULOGNE 881b34d1d6 update po header 2018-08-05 18:50:54 +02:00
Thierry BOULOGNE 0c8958067f fix language code 2018-08-05 18:34:53 +02:00
Thierry BOULOGNE 5dec66b960 update po 2018-08-05 18:29:07 +02:00
Thierry BOULOGNE bc223eb30a remove en 2018-08-05 18:24:56 +02:00
Thierry BOULOGNE 9d3f0d534e Add fr and en Locale 2018-08-05 16:41:07 +02:00
Ilan Steemers e0824802ca Use isinstance instead of typeof 2018-08-05 15:12:18 +02:00
Ilan Steemers 3116e97f9b Fixes overrides 2018-08-05 15:11:43 +02:00
Ilan Steemers 15f8079315 Removes root imports 2018-08-05 14:21:41 +02:00
Ilan Steemers 7d5c9f8b46 removes xrange compat 2018-08-05 13:39:04 +02:00
Ilan Steemers bd062503c5 Adds tracebacks in error logs @strets123 2018-08-05 11:13:16 +02:00
Ilan Steemers 83d90664fb Frees resources on sync run - @abompard 2018-08-05 11:12:14 +02:00
Ilan Steemers acebdaa850 Renames async/enqueue to async_task. 2018-08-01 15:20:34 +02:00
Pierre-Elliott Bécue ae75a84f7f Replaces async occurrences with alternatives
* async is now a reserved word in python3.7
 * Rename async function to enqueue
 * Rename all async_ functions to enqueue_
 * Rename Async class to AsyncTask
 * Updates the docs.
2018-07-07 21:33:43 +02:00
ilan 6bfb6b6e6d 0.9.4 2018-03-13 18:37:40 +01:00
ilan e1d1f0f099 Fixes relative imports 2018-03-13 18:32:49 +01:00
ilan 7c6c318860 0.9.3 2018-03-13 17:43:04 +01:00
ilan 7657bba7f9 Merge remote-tracking branch 'origin/master' 2018-03-13 15:25:12 +01:00
Ilan Steemers d5e430be44 Merge pull request #298 from Balletie/master
Add option for acknowledging failed tasks (globally and per-task)
2018-03-13 15:24:31 +01:00
Eagllus 430c177b92 Move import to the function that uses it
Only Python 2.x is having problems with this import so for now
the fix would be to move the import to the function that uses cluster
2018-03-13 09:37:13 +01:00
Eagllus 8f87bc352f Change imports for cluster and tasks 2018-03-13 09:28:17 +01:00
Eagllus 9c39546417 Change imports signing classes explicit 2018-03-13 09:22:09 +01:00
Eagllus ae9392137c Change path location of django q 2018-03-13 09:21:01 +01:00
Balletie 03abbc960f Add option for acknowledging failed tasks (globally and per-task)
If a task fails with an exception, it is retried until it
succeeds. This is contrary to what is said in the documentation: under
the "Architecture" section, heading "Broker" it says that even when a
task errors, it's still considered a successful delivery. Failed tasks
never get acknowledged however, thereby being retried after the
timeout period. See also issues #238 and #194.

This patch adds an option to acknowledge failures, thereby closing
issue #238. Issue #194 would require some more work. The default of
this option is set to `False`, thereby maintaining backwards
compatibility.
2018-03-09 22:09:46 +01:00
ilan 5969be9e0c Linting 2018-02-20 14:06:23 +01:00
ilan 1f910f5233 v0.9.2 2018-02-13 09:47:34 +01:00
Ilan Steemers 3ba32a32ae Merge pull request #292 from Eagllus/fix_python3_only_code
Fix python3 only code
2018-02-12 16:09:21 +01:00
Eagllus 3f6c0f76a6 Fix super call to work with Python 2.x 2018-02-06 12:10:17 +01:00
Eagllus 0a2aed38d2 Fix Python3 only code.
Thanks to @P-EB for providing the solution
2018-02-06 11:17:09 +01:00
ilan 67ba25119a Version 0.9.1 2018-02-02 10:26:43 +01:00
Eagllus 904daeeddc Fix urls being escaped by admin 2018-01-29 08:45:02 +01:00
Sander van de Graaf 17ea1e7a7b Allow SQS to use environment variables 2018-01-09 13:03:51 +01:00
ilan e22546672e Updates version and docs 2018-01-08 15:33:04 +01:00
Ilan Steemers f353daca53 Merge branch 'django_2_compat' into django_2_compat 2018-01-08 10:53:49 +01:00
ilan 81d4b36b1b Cherry picking compatibility commits 2018-01-08 09:57:20 +01:00
Daniel Welch 98aa75faf1 fix usage of iter_entry_points 2018-01-08 09:45:10 +01:00
Ronald van Zon 5eaa700866 Reverting core_signing to the old way.
By reverting django.core.signing to Django 1.11.8 version Django-Q works
This is not designed as a 'good' solution just to show where I think the
problem is.
2017-12-13 14:49:07 +01:00