Skip to content

Improve docs about acks_on_failure_or_timeout - #9577

Merged
auvipy merged 3 commits into
celery:mainfrom
ya-pekatoros:improve-docs-acks-on-timeout
Mar 12, 2025
Merged

auvipy merged 3 commits into
celery:mainfrom
ya-pekatoros:improve-docs-acks-on-timeout

Conversation

@ya-pekatoros

@ya-pekatoros ya-pekatoros commented Feb 24, 2025 •

Copy link
Copy Markdown
Contributor

Description

This changes makes docs more clear about infinity retries for tasks and acks_on_failure_or_timeout.

The changes add the example of passing max_retries=None to the task decorator to build the task with infinity retries.

Also the changes clarify the docs string of the retry method of the Task removing "first" word, because to make you task retries forever you should only pass the max_retries=None to the Task class itself.

Actually the value of attribute 'acks_on_failure_or_timeout' for Task is 'None' by default.

Yes, if acks_late=False, this logic is disabled, but this information is already in docs. So I suggest to clarify the actual value of this attribute.

@ya-pekatoros

ya-pekatoros commented Feb 24, 2025 •

Copy link
Copy Markdown
Contributor Author

In addition, I wonder about actually ack in case of task fail. I see, what this attribute leads to call on_reject but with requeue=False, and actually change the acknowledged flag to True in case on call "on_failure". In case of Exception without retry task will be acked.

@Nusnus
Nusnus self-requested a review February 24, 2025 14:24
@codecov

codecov Bot commented Feb 24, 2025 •

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 78.30%. Comparing base (c8de124) to head (3025edf).
Report is 48 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #9577   +/-   ##
=======================================
  Coverage   78.30%   78.30%           
=======================================
  Files         153      153           
  Lines       19112    19112           
  Branches     2530     2530           
=======================================
  Hits        14966    14966           
+ Misses       3859     3857    -2     
- Partials      287      289    +2     
Flag Coverage Δ
unittests 78.28% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Nusnus
Nusnus previously requested changes Feb 24, 2025

@Nusnus Nusnus left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR appears to have duplicated / similar changes from #9576, so it needs to be cleared first. Please review the other PR and close it if not relevant, so I’ll know where to focus.

Thanks!

@ya-pekatoros

ya-pekatoros commented Feb 24, 2025 •

Copy link
Copy Markdown
Contributor Author

This PR appears to have duplicated / similar changes from #9576, so it needs to be cleared first. Please review the other PR and close it if not relevant, so I’ll know where to focus.

Thanks!

Thank you for quick reply! Yes, if you agree with the proposal - I can merge both changes.

And I also wonder about this question:
#9577 (comment)
If it's true, may be the acks_on_failure_or_timeout is not the best name of the attribute.

@ya-pekatoros

ya-pekatoros commented Feb 26, 2025 •

Copy link
Copy Markdown
Contributor Author

@Nusnus Hi again! I've closed another PR.

@auvipy auvipy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are the failing tests related to this? may be not right?

@ya-pekatoros

Copy link
Copy Markdown
Contributor Author

@auvipy this PR only update docs... I see what the amount of checks here is greater than in main branch pipeline. 70 vs 68... not sure about this fails... seems not to be connected with these changes.

@auvipy auvipy added this to the 5.5.0 milestone Mar 12, 2025
@auvipy
auvipy merged commit 0316198 into celery:main Mar 12, 2025
@auvipy

auvipy commented Mar 12, 2025

Copy link
Copy Markdown
Member

Thanks

@Nusnus Nusnus left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I want to avoid reverting this PR so I left a few comments to better understand the changes. Take note @ya-pekatoros as this PR was merged during a later RC phase and every change is super sensitive so I want to have very clear motivation for merged changes at the moment or I will be required to revert it to proceed with the release cycle.

I hope you understand, thank you.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Default: Enabled
Default: Disabled

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is inaccurate:

acks_on_failure_or_timeout=Option(True, type='bool'),

@auvipy I didn’t merge this PR as I was waiting to review it. Please be more careful during the RC phase. I’m very sensitive to changes right now due to our super long release phase 🙏

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ya-pekatoros What was the motivation behind changing this?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ughs! thought just as an docs update. shouldn't hurry merging this

When enabled messages for all tasks will be acknowledged even if they
fail or time out.

Configuring this setting only applies to tasks that are

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was this phrasing confusing? What was wrong with it?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Nusnus I think that 'this setting' is more concise and clear variant, because we apply settings. The setting is the subject here.

Nusnus pushed a commit that referenced this pull request Mar 13, 2025
Nusnus pushed a commit that referenced this pull request Mar 16, 2025
Nusnus pushed a commit that referenced this pull request Mar 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants