Created
December 1, 2017 19:04
-
-
Save MickaelBergem/a212bd75227a6c8d94e335304c8b6b86 to your computer and use it in GitHub Desktop.
PoC about a retry bug on Celery
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from celery import Celery | |
class config(object): | |
CELERY_BROKER_CONNECTION_TIMEOUT = 1 # 1s | |
CELERY_BROKER_CONNECTION_MAX_RETRIES = 0 | |
CELERY_BROKER_CONNECTION_RETRY = False | |
CELERY_TASK_PUBLISH_RETRY = False | |
CELERY_TASK_PUBLISH_RETRY_POLICY = { | |
'max_retries': 0, | |
'interval_start': 0, | |
'interval_step': 1, | |
'interval_max': 1, | |
} | |
CELERY_CACHE_BACKEND = "memory" | |
app = Celery( | |
'test', | |
broker='amqp://aaa:bbb@localhost:1234//', | |
) | |
app.config_from_object(config, namespace='CELERY') | |
@app.task | |
def test_task(): | |
print("Executed") | |
if __name__ == '__main__': | |
print("Sending task...") | |
test_task.apply_async((), retry=False) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment