From 1e5f3f0d5c818f77f3eb56c0c7153150ab22baab Mon Sep 17 00:00:00 2001 From: Manuel Kaufmann Date: Tue, 12 Aug 2025 11:08:16 +0200 Subject: [PATCH 1/4] Build: auto-disable `ACKS_LATE` for long builds If the project has a custom `Project.container_time_limit` we make the task to be `acks_late=False`. --- readthedocs/core/utils/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readthedocs/core/utils/__init__.py b/readthedocs/core/utils/__init__.py index 5617350d075..ddae865b32a 100644 --- a/readthedocs/core/utils/__init__.py +++ b/readthedocs/core/utils/__init__.py @@ -161,7 +161,7 @@ def prepare_build( # At 1h exactly, the task is grabbed by another worker and re-executed, # even while it's still running on the original worker. # https://github.com/readthedocs/readthedocs.org/issues/12317 - if project.has_feature(Feature.BUILD_NO_ACKS_LATE): + if project.has_feature(Feature.BUILD_NO_ACKS_LATE) or project.container_time_limit >= 3600: log.info("Disabling ACKS_LATE for this particular build.") options["acks_late"] = False From c02ab504ee13f9e22ff70644f72f65a9c27817dc Mon Sep 17 00:00:00 2001 From: Manuel Kaufmann Date: Wed, 13 Aug 2025 20:01:56 +0200 Subject: [PATCH 2/4] Check for `None` --- readthedocs/core/utils/__init__.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/readthedocs/core/utils/__init__.py b/readthedocs/core/utils/__init__.py index ddae865b32a..a460affe315 100644 --- a/readthedocs/core/utils/__init__.py +++ b/readthedocs/core/utils/__init__.py @@ -161,7 +161,11 @@ def prepare_build( # At 1h exactly, the task is grabbed by another worker and re-executed, # even while it's still running on the original worker. # https://github.com/readthedocs/readthedocs.org/issues/12317 - if project.has_feature(Feature.BUILD_NO_ACKS_LATE) or project.container_time_limit >= 3600: + if ( + project.has_feature(Feature.BUILD_NO_ACKS_LATE) + or project.container_time_limit + and project.container_time_limit >= 3600 + ): log.info("Disabling ACKS_LATE for this particular build.") options["acks_late"] = False From bdb34f6d7415b628087760630202502b07d30071 Mon Sep 17 00:00:00 2001 From: Manuel Kaufmann Date: Wed, 13 Aug 2025 20:05:43 +0200 Subject: [PATCH 3/4] Always use no acks late when build time is bigger than default --- readthedocs/core/utils/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readthedocs/core/utils/__init__.py b/readthedocs/core/utils/__init__.py index a460affe315..6dd928f0f47 100644 --- a/readthedocs/core/utils/__init__.py +++ b/readthedocs/core/utils/__init__.py @@ -164,7 +164,7 @@ def prepare_build( if ( project.has_feature(Feature.BUILD_NO_ACKS_LATE) or project.container_time_limit - and project.container_time_limit >= 3600 + and project.container_time_limit >= settings.BUILD_TIME_LIMIT ): log.info("Disabling ACKS_LATE for this particular build.") options["acks_late"] = False From f4fd39af0c950776561c3fc4dc93f7fb5fa5ae88 Mon Sep 17 00:00:00 2001 From: Manuel Kaufmann Date: Thu, 14 Aug 2025 10:51:28 +0200 Subject: [PATCH 4/4] Feedback from review --- readthedocs/core/utils/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readthedocs/core/utils/__init__.py b/readthedocs/core/utils/__init__.py index 6dd928f0f47..78b69c2c943 100644 --- a/readthedocs/core/utils/__init__.py +++ b/readthedocs/core/utils/__init__.py @@ -164,7 +164,7 @@ def prepare_build( if ( project.has_feature(Feature.BUILD_NO_ACKS_LATE) or project.container_time_limit - and project.container_time_limit >= settings.BUILD_TIME_LIMIT + and project.container_time_limit > settings.BUILD_TIME_LIMIT ): log.info("Disabling ACKS_LATE for this particular build.") options["acks_late"] = False