超时异常是否会确认 acks_late 的任务?
Does a timeout exception ack a task with acks_late?
如果我有一个带有 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是一个异常,按理说它确实会确认消息并将其从队列中移除。
如果我有一个带有 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是一个异常,按理说它确实会确认消息并将其从队列中移除。