timeout - 超时异常是否使用 acks_late 确认任务?

标签 timeout celery

如果我有一个带有 acks_late=True 的 celery 任务,并且该任务引发了硬超时或软超时异常,那么该任务是被确认并从队列中删除,还是重试? acks_late 的文档无论如何都没有提及。

最佳答案

根据Should I use retry or acks_late ,

Task.retry is used to retry tasks, notably for expected errors that is catchable with the try: block. The AMQP transaction is not used for these errors: if the task raises an exception it is still acknowledged!

由于 SoftTimeLimitExceeded 是一个异常,因此它确实会确认消息并将其从队列中删除。

关于timeout - 超时异常是否使用 acks_late 确认任务?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34029222/

相关文章:

java - RequestConfig 和 IOReactorConfig 超时设置的区别?

c# - C# 串口超时

如果卡住的 AD 服务器没有应答,PowerShell 调用命令超时

django - "CELERY_BEAT_SCHEDULER"配置在 django 设置中不起作用

django - 我想将 django 与 celery (redis) 一起使用。我需要在 django 应用程序的服务器上安装 redis 吗?或者我可以有一个单独的redis服务器吗?

Javascript setTimeout() 涉及括号的问题

php - 如何为使用 php 执行的 ssh 命令设置超时?

python - Celery 的异步替换

python - celery 停止执行链

python - 为什么 celery 没有干净地关闭?