Skip to content

Commit 3cc91c4

Browse files
authored
Builds: feature flag to disable ACKS_LATE per project (#12354)
Another attempt to run builds longer than 1h in a reliably way. Related: #12317
1 parent 140be4a commit 3cc91c4

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

readthedocs/core/utils/__init__.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ def prepare_build(
4949
from readthedocs.api.v2.models import BuildAPIKey
5050
from readthedocs.builds.models import Build
5151
from readthedocs.builds.tasks import send_build_notifications
52+
from readthedocs.projects.models import Feature
5253
from readthedocs.projects.models import Project
5354
from readthedocs.projects.models import WebHookEvent
5455
from readthedocs.projects.tasks.builds import update_docs_task
@@ -171,6 +172,14 @@ def prepare_build(
171172

172173
_, build_api_key = BuildAPIKey.objects.create_key(project=project)
173174

175+
# Disable ``ACKS_LATE`` for this particular build task to try out running builders longer than 1h.
176+
# At 1h exactly, the task is grabbed by another worker and re-executed,
177+
# even while it's still running on the original worker.
178+
# https://github.com/readthedocs/readthedocs.org/issues/12317
179+
if project.has_feature(Feature.BUILD_NO_ACKS_LATE):
180+
log.info("Disabling ACKS_LATE for this particular build.")
181+
options["acks_late"] = False
182+
174183
return (
175184
update_docs_task.signature(
176185
args=(

readthedocs/projects/models.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1977,6 +1977,7 @@ def add_features(sender, **kwargs):
19771977
SCALE_IN_PROTECTION = "scale_in_prtection"
19781978
USE_S3_SCOPED_CREDENTIALS_ON_BUILDERS = "use_s3_scoped_credentials_on_builders"
19791979
BUILD_HEALTHCHECK = "build_healthcheck"
1980+
BUILD_NO_ACKS_LATE = "build_no_acks_late"
19801981

19811982
FEATURES = (
19821983
(
@@ -2055,6 +2056,10 @@ def add_features(sender, **kwargs):
20552056
BUILD_HEALTHCHECK,
20562057
_("Build: Use background cURL healthcheck."),
20572058
),
2059+
(
2060+
BUILD_NO_ACKS_LATE,
2061+
_("Build: Do not use Celery ASK_LATE config for this project."),
2062+
),
20582063
)
20592064

20602065
FEATURES = sorted(FEATURES, key=lambda x: x[1])

0 commit comments

Comments
 (0)