Skip to content

Commit 01a022a

Browse files
authored
fix(relocation): Right size validation step timeouts (#68229)
These had previously been increased in #68080 and again in #68120 to aid with debugging. Now that #68140 has addressed the root cause of these excessively long imports, we can bring these timeouts down to a more reasonable level. One benefit of the episode is that we now know how long it takes to import/export a ~50MB relocation file. Based on this, we've set the timeouts back to 5 minutes for tasks we expect to be quick (handling `baseline-config` and `colliding-user` steps), while increasing the timeouts for the actual relocation import/export steps to 40 minutes. Since even very large comparisons proved quite quick, we're lowering that timeout to 2 minutes.
1 parent 4b9d5e4 commit 01a022a

File tree

2 files changed

+19
-9
lines changed

2 files changed

+19
-9
lines changed

src/sentry/utils/relocation.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ class OrderedTask(Enum):
219219
- "--findings-file"
220220
- "/findings/import-$jsonfile"
221221
$args
222-
timeout: 2400s
222+
timeout: $timeout
223223
"""
224224
)
225225

@@ -250,7 +250,7 @@ class OrderedTask(Enum):
250250
- "--findings-file"
251251
- "/findings/export-$jsonfile"
252252
$args
253-
timeout: 2400s
253+
timeout: $timeout
254254
"""
255255
)
256256

@@ -297,7 +297,7 @@ class OrderedTask(Enum):
297297
- "--findings-file"
298298
- "/findings/compare-$jsonfile"
299299
$args
300-
timeout: 300s
300+
timeout: $timeout
301301
"""
302302
)
303303

@@ -574,6 +574,7 @@ def create_cloudbuild_yaml(relocation: Relocation) -> bytes:
574574
id="import-baseline-config",
575575
step=IMPORT_VALIDATION_STEP_TEMPLATE,
576576
scope="config",
577+
timeout=300,
577578
wait_for=[],
578579
kind=RelocationFile.Kind.BASELINE_CONFIG_VALIDATION_DATA,
579580
args=["--overwrite-configs"],
@@ -582,6 +583,7 @@ def create_cloudbuild_yaml(relocation: Relocation) -> bytes:
582583
id="import-colliding-users",
583584
step=IMPORT_VALIDATION_STEP_TEMPLATE,
584585
scope="users",
586+
timeout=300,
585587
wait_for=["import-baseline-config"],
586588
kind=RelocationFile.Kind.COLLIDING_USERS_VALIDATION_DATA,
587589
args=filter_usernames_args,
@@ -590,6 +592,7 @@ def create_cloudbuild_yaml(relocation: Relocation) -> bytes:
590592
id="import-raw-relocation-data",
591593
step=IMPORT_VALIDATION_STEP_TEMPLATE,
592594
scope="organizations",
595+
timeout=2400,
593596
wait_for=["import-colliding-users"],
594597
kind=RelocationFile.Kind.RAW_USER_DATA,
595598
args=filter_org_slugs_args,
@@ -598,6 +601,7 @@ def create_cloudbuild_yaml(relocation: Relocation) -> bytes:
598601
id="export-baseline-config",
599602
step=EXPORT_VALIDATION_STEP_TEMPLATE,
600603
scope="config",
604+
timeout=300,
601605
wait_for=["import-raw-relocation-data"],
602606
kind=RelocationFile.Kind.BASELINE_CONFIG_VALIDATION_DATA,
603607
args=[],
@@ -606,6 +610,7 @@ def create_cloudbuild_yaml(relocation: Relocation) -> bytes:
606610
id="export-colliding-users",
607611
step=EXPORT_VALIDATION_STEP_TEMPLATE,
608612
scope="users",
613+
timeout=300,
609614
wait_for=["export-baseline-config"],
610615
kind=RelocationFile.Kind.COLLIDING_USERS_VALIDATION_DATA,
611616
args=filter_usernames_args,
@@ -614,6 +619,7 @@ def create_cloudbuild_yaml(relocation: Relocation) -> bytes:
614619
id="export-raw-relocation-data",
615620
step=EXPORT_VALIDATION_STEP_TEMPLATE,
616621
scope="organizations",
622+
timeout=2400,
617623
wait_for=["export-colliding-users"],
618624
kind=RelocationFile.Kind.RAW_USER_DATA,
619625
args=filter_org_slugs_args,
@@ -627,6 +633,7 @@ def create_cloudbuild_yaml(relocation: Relocation) -> bytes:
627633
id="compare-baseline-config",
628634
step=COMPARE_VALIDATION_STEP_TEMPLATE,
629635
scope="config",
636+
timeout=120,
630637
wait_for=["export-raw-relocation-data"],
631638
kind=RelocationFile.Kind.BASELINE_CONFIG_VALIDATION_DATA,
632639
args=[],
@@ -635,6 +642,7 @@ def create_cloudbuild_yaml(relocation: Relocation) -> bytes:
635642
id="compare-colliding-users",
636643
step=COMPARE_VALIDATION_STEP_TEMPLATE,
637644
scope="users",
645+
timeout=120,
638646
wait_for=["compare-baseline-config"],
639647
kind=RelocationFile.Kind.COLLIDING_USERS_VALIDATION_DATA,
640648
args=[],
@@ -664,6 +672,7 @@ def create_cloudbuild_validation_step(
664672
scope: str,
665673
wait_for: list[str],
666674
kind: RelocationFile.Kind,
675+
timeout: int,
667676
args: list[str],
668677
) -> str:
669678
return step.substitute(
@@ -674,5 +683,6 @@ def create_cloudbuild_validation_step(
674683
kind=str(kind),
675684
scope=scope,
676685
tarfile=kind.to_filename("tar"),
686+
timeout=str(timeout) + "s",
677687
wait_for=make_cloudbuild_step_args(3, wait_for),
678688
)

tests/sentry/tasks/snapshots/PreprocessingTransferTest/test_success.pysnap

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ steps:
127127
- --overwrite-configs
128128
id: import-baseline-config
129129
name: gcr.io/cloud-builders/docker
130-
timeout: 2400s
130+
timeout: 300s
131131
waitFor:
132132
- copy-inputs-being-validated
133133
- create-working-dirs
@@ -157,7 +157,7 @@ steps:
157157
- importing
158158
id: import-colliding-users
159159
name: gcr.io/cloud-builders/docker
160-
timeout: 2400s
160+
timeout: 300s
161161
waitFor:
162162
- copy-inputs-being-validated
163163
- create-working-dirs
@@ -221,7 +221,7 @@ steps:
221221
- /findings/export-baseline-config.json
222222
id: export-baseline-config
223223
name: gcr.io/cloud-builders/docker
224-
timeout: 2400s
224+
timeout: 300s
225225
waitFor:
226226
- import-baseline-config
227227
- import-raw-relocation-data
@@ -254,7 +254,7 @@ steps:
254254
- importing
255255
id: export-colliding-users
256256
name: gcr.io/cloud-builders/docker
257-
timeout: 2400s
257+
timeout: 300s
258258
waitFor:
259259
- import-colliding-users
260260
- export-baseline-config
@@ -329,7 +329,7 @@ steps:
329329
- /findings/compare-baseline-config.json
330330
id: compare-baseline-config
331331
name: gcr.io/cloud-builders/docker
332-
timeout: 300s
332+
timeout: 120s
333333
waitFor:
334334
- export-baseline-config
335335
- export-raw-relocation-data
@@ -361,7 +361,7 @@ steps:
361361
- /findings/compare-colliding-users.json
362362
id: compare-colliding-users
363363
name: gcr.io/cloud-builders/docker
364-
timeout: 300s
364+
timeout: 120s
365365
waitFor:
366366
- export-colliding-users
367367
- compare-baseline-config

0 commit comments

Comments
 (0)