Skip to content

Build: auto-disable ACKS_LATE for long builds #12393

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Aug 14, 2025

Conversation

humitos
Copy link
Member

@humitos humitos commented Aug 12, 2025

When a customer/user requests longer builds, we set container_time_limit at project level. However, if the time is longer than 1h we also need to add BUILD_NO_ACKS_LATE to that project. This PR checks for that limit and if it's longer than 1h adds acks_late=False to the build task.

Related to #12369

@humitos humitos requested a review from a team as a code owner August 12, 2025 09:12
@humitos humitos requested a review from agjohnson August 12, 2025 09:12
Copy link

read-the-docs-community bot commented Aug 12, 2025

Documentation build overview

📚 dev | 🛠️ build #29199086 (f4fd39a) | 🔍 preview

Files changed

Comparing with latest (5b25fdb...f4fd39a)

No files changed.

Base automatically changed from humitos/build-time-limits to main August 12, 2025 15:47
@humitos humitos requested a review from a team as a code owner August 12, 2025 15:47
@@ -605,7 +632,7 @@ def TEMPLATES(self):
# https://github.com/readthedocs/readthedocs.org/issues/12317#issuecomment-3070950434
# https://docs.celeryq.dev/en/stable/getting-started/backends-and-brokers/redis.html#visibility-timeout
BROKER_TRANSPORT_OPTIONS = {
'visibility_timeout': 18000, # 5 hours
'visibility_timeout': BUILD_TIME_LIMIT * 1.15, # 15% more than the build time limit
Copy link
Contributor

Choose a reason for hiding this comment

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

We know this value does nothing either way, but for builds that are using acks_late, this would worsen the effect -- builds running later than 15/30 minutes + 15% would restart on another builder. I don't think we want this value low while we are using acks late.

Copy link
Member Author

Choose a reason for hiding this comment

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

+15/+30 minutes build should always use acks_late=False via Feature.BUILD_NO_ACKS_LATE to disable the visibility timeout issue we had, actually. In other words, projects with custom container_time_limit should always use Feature.BUILD_NO_ACKS_LATE; which is what this PR does to avoid these issues.

Builds running the default time limit + 15% should be fine with this value.

Copy link
Contributor

Choose a reason for hiding this comment

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

So that sounds fine, but right now these projects are using acks late, and the condition for not using acks late in this PR only matches for projects with a time limit > 1 hour. I think you want to make any custom value trigger no acks late instead, but this is a bug currently in production though, because acks late is not being used.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, I realized that and updated the code to check for custom time limit 👍

@humitos
Copy link
Member Author

humitos commented Aug 13, 2025

Not sure what happened with the diff here. The only new commit is a178baa (#12393).

I will try to rebase this branch.

If the project has a custom `Project.container_time_limit` we make the task to
be `acks_late=False`.
@humitos humitos force-pushed the humitos/acks-late-custom-time branch from a178baa to 1e5f3f0 Compare August 13, 2025 11:08
@humitos
Copy link
Member Author

humitos commented Aug 13, 2025

The feedback you gave me, may be still relevant for #12369, tho

@agjohnson
Copy link
Contributor

With that PR already merged, we should address these issues before we go too much further. I think we probably just introduced the visibility timeout retry issue for any build longer than the default 15/30 minutes with that PR.

@humitos
Copy link
Member Author

humitos commented Aug 13, 2025

I replied all the feedback with explanations. Let me know if I'm explaining myself here.

@humitos humitos requested a review from agjohnson August 13, 2025 18:00
@humitos humitos force-pushed the humitos/acks-late-custom-time branch from df7f97f to bdb34f6 Compare August 13, 2025 18:07
@humitos humitos enabled auto-merge (squash) August 14, 2025 08:52
Copy link

Documentation build overview

📚 docs | 🛠️ build #29199087 (f4fd39a) | 🔍 preview

Files changed

Comparing with latest (5b25fdb...f4fd39a)

Show files (2) | 2 modified | 0 added | 0 deleted
File Status
config-file/index.html 📝 modified
config-file/v2.html 📝 modified

@humitos humitos merged commit 401b375 into main Aug 14, 2025
4 checks passed
@humitos humitos deleted the humitos/acks-late-custom-time branch August 14, 2025 09:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants