|
58 | 58 | RegionRelocationTransfer,
|
59 | 59 | RelocationTransferState,
|
60 | 60 | )
|
| 61 | +from sentry.relocation.tasks import relocation_tasks |
61 | 62 | from sentry.relocation.tasks.transfer import process_relocation_transfer_region
|
62 | 63 | from sentry.relocation.utils import (
|
63 | 64 | TASK_TO_STEP,
|
|
74 | 75 | from sentry.signals import relocated, relocation_redeem_promo_code
|
75 | 76 | from sentry.silo.base import SiloMode
|
76 | 77 | from sentry.tasks.base import instrumented_task
|
| 78 | +from sentry.taskworker.config import TaskworkerConfig |
| 79 | +from sentry.taskworker.retry import LastAction, Retry |
77 | 80 | from sentry.types.region import get_local_region
|
78 | 81 | from sentry.users.models.lostpasswordhash import LostPasswordHash
|
79 | 82 | from sentry.users.models.user import User
|
|
160 | 163 | retry_backoff=RETRY_BACKOFF,
|
161 | 164 | retry_backoff_jitter=True,
|
162 | 165 | soft_time_limit=FAST_TIME_LIMIT,
|
| 166 | + taskworker_config=TaskworkerConfig( |
| 167 | + namespace=relocation_tasks, |
| 168 | + processing_deadline_duration=FAST_TIME_LIMIT, |
| 169 | + retry=Retry( |
| 170 | + times=MAX_FAST_TASK_RETRIES, on=(Exception,), times_exceeded=LastAction.Discard |
| 171 | + ), |
| 172 | + ), |
163 | 173 | )
|
164 | 174 | def uploading_start(uuid: UUID, replying_region_name: str | None, org_slug: str | None) -> None:
|
165 | 175 | """
|
@@ -320,6 +330,11 @@ def uploading_start(uuid: UUID, replying_region_name: str | None, org_slug: str
|
320 | 330 | # 10 minutes per try.
|
321 | 331 | soft_time_limit=60 * 10,
|
322 | 332 | silo_mode=SiloMode.REGION,
|
| 333 | + taskworker_config=TaskworkerConfig( |
| 334 | + namespace=relocation_tasks, |
| 335 | + processing_deadline_duration=60 * 10, |
| 336 | + retry=Retry(times=4, on=(Exception,), times_exceeded=LastAction.Discard), |
| 337 | + ), |
323 | 338 | )
|
324 | 339 | def fulfill_cross_region_export_request(
|
325 | 340 | uuid_str: str,
|
@@ -431,6 +446,13 @@ def fulfill_cross_region_export_request(
|
431 | 446 | retry_backoff_jitter=True,
|
432 | 447 | soft_time_limit=FAST_TIME_LIMIT,
|
433 | 448 | silo_mode=SiloMode.REGION,
|
| 449 | + taskworker_config=TaskworkerConfig( |
| 450 | + namespace=relocation_tasks, |
| 451 | + processing_deadline_duration=FAST_TIME_LIMIT, |
| 452 | + retry=Retry( |
| 453 | + times=MAX_FAST_TASK_RETRIES, on=(Exception,), times_exceeded=LastAction.Discard |
| 454 | + ), |
| 455 | + ), |
434 | 456 | )
|
435 | 457 | def cross_region_export_timeout_check(
|
436 | 458 | uuid: UUID,
|
@@ -488,6 +510,13 @@ def cross_region_export_timeout_check(
|
488 | 510 | retry_backoff=RETRY_BACKOFF,
|
489 | 511 | retry_backoff_jitter=True,
|
490 | 512 | soft_time_limit=FAST_TIME_LIMIT,
|
| 513 | + taskworker_config=TaskworkerConfig( |
| 514 | + namespace=relocation_tasks, |
| 515 | + processing_deadline_duration=FAST_TIME_LIMIT, |
| 516 | + retry=Retry( |
| 517 | + times=MAX_FAST_TASK_RETRIES, on=(Exception,), times_exceeded=LastAction.Discard |
| 518 | + ), |
| 519 | + ), |
491 | 520 | )
|
492 | 521 | def uploading_complete(uuid: UUID) -> None:
|
493 | 522 | """
|
@@ -535,6 +564,13 @@ def uploading_complete(uuid: UUID) -> None:
|
535 | 564 | retry_backoff_jitter=True,
|
536 | 565 | soft_time_limit=MEDIUM_TIME_LIMIT,
|
537 | 566 | silo_mode=SiloMode.REGION,
|
| 567 | + taskworker_config=TaskworkerConfig( |
| 568 | + namespace=relocation_tasks, |
| 569 | + processing_deadline_duration=MEDIUM_TIME_LIMIT, |
| 570 | + retry=Retry( |
| 571 | + times=MAX_FAST_TASK_RETRIES, on=(Exception,), times_exceeded=LastAction.Discard |
| 572 | + ), |
| 573 | + ), |
538 | 574 | )
|
539 | 575 | def preprocessing_scan(uuid: UUID) -> None:
|
540 | 576 | """
|
@@ -709,6 +745,13 @@ def preprocessing_scan(uuid: UUID) -> None:
|
709 | 745 | retry_backoff_jitter=True,
|
710 | 746 | soft_time_limit=MEDIUM_TIME_LIMIT,
|
711 | 747 | silo_mode=SiloMode.REGION,
|
| 748 | + taskworker_config=TaskworkerConfig( |
| 749 | + namespace=relocation_tasks, |
| 750 | + processing_deadline_duration=MEDIUM_TIME_LIMIT, |
| 751 | + retry=Retry( |
| 752 | + times=MAX_FAST_TASK_RETRIES, on=(Exception,), times_exceeded=LastAction.Discard |
| 753 | + ), |
| 754 | + ), |
712 | 755 | )
|
713 | 756 | def preprocessing_transfer(uuid: UUID) -> None:
|
714 | 757 | """
|
@@ -797,6 +840,13 @@ def preprocessing_transfer(uuid: UUID) -> None:
|
797 | 840 | retry_backoff_jitter=True,
|
798 | 841 | soft_time_limit=MEDIUM_TIME_LIMIT,
|
799 | 842 | silo_mode=SiloMode.REGION,
|
| 843 | + taskworker_config=TaskworkerConfig( |
| 844 | + namespace=relocation_tasks, |
| 845 | + processing_deadline_duration=MEDIUM_TIME_LIMIT, |
| 846 | + retry=Retry( |
| 847 | + times=MAX_FAST_TASK_RETRIES, on=(Exception,), times_exceeded=LastAction.Discard |
| 848 | + ), |
| 849 | + ), |
800 | 850 | )
|
801 | 851 | def preprocessing_baseline_config(uuid: UUID) -> None:
|
802 | 852 | """
|
@@ -848,6 +898,13 @@ def preprocessing_baseline_config(uuid: UUID) -> None:
|
848 | 898 | retry_backoff_jitter=True,
|
849 | 899 | soft_time_limit=MEDIUM_TIME_LIMIT,
|
850 | 900 | silo_mode=SiloMode.REGION,
|
| 901 | + taskworker_config=TaskworkerConfig( |
| 902 | + namespace=relocation_tasks, |
| 903 | + processing_deadline_duration=MEDIUM_TIME_LIMIT, |
| 904 | + retry=Retry( |
| 905 | + times=MAX_FAST_TASK_RETRIES, on=(Exception,), times_exceeded=LastAction.Discard |
| 906 | + ), |
| 907 | + ), |
851 | 908 | )
|
852 | 909 | def preprocessing_colliding_users(uuid: UUID) -> None:
|
853 | 910 | """
|
@@ -897,6 +954,13 @@ def preprocessing_colliding_users(uuid: UUID) -> None:
|
897 | 954 | retry_backoff_jitter=True,
|
898 | 955 | soft_time_limit=MEDIUM_TIME_LIMIT,
|
899 | 956 | silo_mode=SiloMode.REGION,
|
| 957 | + taskworker_config=TaskworkerConfig( |
| 958 | + namespace=relocation_tasks, |
| 959 | + processing_deadline_duration=MEDIUM_TIME_LIMIT, |
| 960 | + retry=Retry( |
| 961 | + times=MAX_FAST_TASK_RETRIES, on=(Exception,), times_exceeded=LastAction.Discard |
| 962 | + ), |
| 963 | + ), |
900 | 964 | )
|
901 | 965 | def preprocessing_complete(uuid: UUID) -> None:
|
902 | 966 | """
|
@@ -1115,6 +1179,13 @@ def _update_relocation_validation_attempt(
|
1115 | 1179 | retry_backoff_jitter=True,
|
1116 | 1180 | soft_time_limit=FAST_TIME_LIMIT,
|
1117 | 1181 | silo_mode=SiloMode.REGION,
|
| 1182 | + taskworker_config=TaskworkerConfig( |
| 1183 | + namespace=relocation_tasks, |
| 1184 | + processing_deadline_duration=FAST_TIME_LIMIT, |
| 1185 | + retry=Retry( |
| 1186 | + times=MAX_FAST_TASK_RETRIES, on=(Exception,), times_exceeded=LastAction.Discard |
| 1187 | + ), |
| 1188 | + ), |
1118 | 1189 | )
|
1119 | 1190 | def validating_start(uuid: UUID) -> None:
|
1120 | 1191 | """
|
@@ -1194,6 +1265,11 @@ def camel_to_snake_keep_underscores(value):
|
1194 | 1265 | retry_backoff_jitter=True,
|
1195 | 1266 | soft_time_limit=FAST_TIME_LIMIT,
|
1196 | 1267 | silo_mode=SiloMode.REGION,
|
| 1268 | + taskworker_config=TaskworkerConfig( |
| 1269 | + namespace=relocation_tasks, |
| 1270 | + processing_deadline_duration=FAST_TIME_LIMIT, |
| 1271 | + retry=Retry(times=MAX_VALIDATION_POLLS, on=(Exception,), times_exceeded=LastAction.Discard), |
| 1272 | + ), |
1197 | 1273 | )
|
1198 | 1274 | def validating_poll(uuid: UUID, build_id: str) -> None:
|
1199 | 1275 | """
|
@@ -1292,6 +1368,13 @@ def validating_poll(uuid: UUID, build_id: str) -> None:
|
1292 | 1368 | retry_backoff_jitter=True,
|
1293 | 1369 | soft_time_limit=FAST_TIME_LIMIT,
|
1294 | 1370 | silo_mode=SiloMode.REGION,
|
| 1371 | + taskworker_config=TaskworkerConfig( |
| 1372 | + namespace=relocation_tasks, |
| 1373 | + processing_deadline_duration=FAST_TIME_LIMIT, |
| 1374 | + retry=Retry( |
| 1375 | + times=MAX_FAST_TASK_RETRIES, on=(Exception,), times_exceeded=LastAction.Discard |
| 1376 | + ), |
| 1377 | + ), |
1295 | 1378 | )
|
1296 | 1379 | def validating_complete(uuid: UUID, build_id: str) -> None:
|
1297 | 1380 | """
|
@@ -1380,6 +1463,13 @@ def validating_complete(uuid: UUID, build_id: str) -> None:
|
1380 | 1463 | acks_late=True,
|
1381 | 1464 | soft_time_limit=SLOW_TIME_LIMIT,
|
1382 | 1465 | silo_mode=SiloMode.REGION,
|
| 1466 | + taskworker_config=TaskworkerConfig( |
| 1467 | + namespace=relocation_tasks, |
| 1468 | + processing_deadline_duration=SLOW_TIME_LIMIT, |
| 1469 | + retry=Retry( |
| 1470 | + times=MAX_SLOW_TASK_RETRIES, on=(Exception,), times_exceeded=LastAction.Discard |
| 1471 | + ), |
| 1472 | + ), |
1383 | 1473 | )
|
1384 | 1474 | def importing(uuid: UUID) -> None:
|
1385 | 1475 | """
|
@@ -1442,6 +1532,13 @@ def importing(uuid: UUID) -> None:
|
1442 | 1532 | retry_backoff_jitter=True,
|
1443 | 1533 | soft_time_limit=FAST_TIME_LIMIT,
|
1444 | 1534 | silo_mode=SiloMode.REGION,
|
| 1535 | + taskworker_config=TaskworkerConfig( |
| 1536 | + namespace=relocation_tasks, |
| 1537 | + processing_deadline_duration=FAST_TIME_LIMIT, |
| 1538 | + retry=Retry( |
| 1539 | + times=MAX_FAST_TASK_RETRIES, on=(Exception,), times_exceeded=LastAction.Discard |
| 1540 | + ), |
| 1541 | + ), |
1445 | 1542 | )
|
1446 | 1543 | def postprocessing(uuid: UUID) -> None:
|
1447 | 1544 | """
|
@@ -1534,6 +1631,13 @@ def postprocessing(uuid: UUID) -> None:
|
1534 | 1631 | retry_backoff_jitter=True,
|
1535 | 1632 | soft_time_limit=FAST_TIME_LIMIT,
|
1536 | 1633 | silo_mode=SiloMode.REGION,
|
| 1634 | + taskworker_config=TaskworkerConfig( |
| 1635 | + namespace=relocation_tasks, |
| 1636 | + processing_deadline_duration=FAST_TIME_LIMIT, |
| 1637 | + retry=Retry( |
| 1638 | + times=MAX_FAST_TASK_RETRIES, on=(Exception,), times_exceeded=LastAction.Discard |
| 1639 | + ), |
| 1640 | + ), |
1537 | 1641 | )
|
1538 | 1642 | def notifying_unhide(uuid: UUID) -> None:
|
1539 | 1643 | """
|
@@ -1580,6 +1684,13 @@ def notifying_unhide(uuid: UUID) -> None:
|
1580 | 1684 | retry_backoff_jitter=True,
|
1581 | 1685 | soft_time_limit=FAST_TIME_LIMIT,
|
1582 | 1686 | silo_mode=SiloMode.REGION,
|
| 1687 | + taskworker_config=TaskworkerConfig( |
| 1688 | + namespace=relocation_tasks, |
| 1689 | + processing_deadline_duration=FAST_TIME_LIMIT, |
| 1690 | + retry=Retry( |
| 1691 | + times=MAX_FAST_TASK_RETRIES, on=(Exception,), times_exceeded=LastAction.Discard |
| 1692 | + ), |
| 1693 | + ), |
1583 | 1694 | )
|
1584 | 1695 | def notifying_users(uuid: UUID) -> None:
|
1585 | 1696 | """
|
@@ -1654,6 +1765,13 @@ def notifying_users(uuid: UUID) -> None:
|
1654 | 1765 | retry_backoff_jitter=True,
|
1655 | 1766 | soft_time_limit=FAST_TIME_LIMIT,
|
1656 | 1767 | silo_mode=SiloMode.REGION,
|
| 1768 | + taskworker_config=TaskworkerConfig( |
| 1769 | + namespace=relocation_tasks, |
| 1770 | + processing_deadline_duration=FAST_TIME_LIMIT, |
| 1771 | + retry=Retry( |
| 1772 | + times=MAX_FAST_TASK_RETRIES, on=(Exception,), times_exceeded=LastAction.Discard |
| 1773 | + ), |
| 1774 | + ), |
1657 | 1775 | )
|
1658 | 1776 | def notifying_owner(uuid: UUID) -> None:
|
1659 | 1777 | """
|
@@ -1702,6 +1820,13 @@ def notifying_owner(uuid: UUID) -> None:
|
1702 | 1820 | retry_backoff_jitter=True,
|
1703 | 1821 | soft_time_limit=FAST_TIME_LIMIT,
|
1704 | 1822 | silo_mode=SiloMode.REGION,
|
| 1823 | + taskworker_config=TaskworkerConfig( |
| 1824 | + namespace=relocation_tasks, |
| 1825 | + processing_deadline_duration=FAST_TIME_LIMIT, |
| 1826 | + retry=Retry( |
| 1827 | + times=MAX_FAST_TASK_RETRIES, on=(Exception,), times_exceeded=LastAction.Discard |
| 1828 | + ), |
| 1829 | + ), |
1705 | 1830 | )
|
1706 | 1831 | def completed(uuid: UUID) -> None:
|
1707 | 1832 | """
|
|
0 commit comments