Skip to content

Commit

Permalink
fix(dynamic-sampling): adjust task time limits (#80453)
Browse files Browse the repository at this point in the history
Adjust task time limits with values taken from previous runtime profiles

Make sure that `time_limit` is always `soft_time_limit + 5`

Closes getsentry/projects#371
  • Loading branch information
constantinius authored Nov 12, 2024
1 parent 34532d2 commit dee5394
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@
queue="dynamicsampling",
default_retry_delay=5,
max_retries=5,
soft_time_limit=2 * 60 * 60,
time_limit=2 * 60 * 60 + 5,
soft_time_limit=5 * 60, # 5 minutes
time_limit=5 * 60 + 5,
silo_mode=SiloMode.REGION,
)
@dynamic_sampling_task_with_context(max_task_execution=MAX_TASK_SECONDS)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ class ProjectTransactionsTotals(TypedDict, total=True):
queue="dynamicsampling",
default_retry_delay=5,
max_retries=5,
soft_time_limit=2 * 60 * 60,
time_limit=2 * 60 * 60 + 5,
soft_time_limit=6 * 60, # 6 minutes
time_limit=6 * 60 + 5,
silo_mode=SiloMode.REGION,
)
@dynamic_sampling_task_with_context(max_task_execution=MAX_TASK_SECONDS)
Expand Down Expand Up @@ -150,8 +150,8 @@ def boost_low_volume_transactions(context: TaskContext) -> None:
queue="dynamicsampling",
default_retry_delay=5,
max_retries=5,
soft_time_limit=25 * 60,
time_limit=2 * 60 + 5,
soft_time_limit=4 * 60, # 4 minutes
time_limit=4 * 60 + 5,
silo_mode=SiloMode.REGION,
)
@dynamic_sampling_task
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
queue="dynamicsampling",
default_retry_delay=5,
max_retries=5,
soft_time_limit=2 * 60 * 60, # 2hours
time_limit=2 * 60 * 60 + 5,
soft_time_limit=1 * 60, # 1 minute
time_limit=1 * 60 + 5,
silo_mode=SiloMode.REGION,
)
@dynamic_sampling_task_with_context(max_task_execution=MAX_TASK_SECONDS)
Expand Down Expand Up @@ -180,8 +180,8 @@ def create_discover_link(rule: CustomDynamicSamplingRule, projects: list[int]) -
queue="dynamicsampling",
default_retry_delay=5,
max_retries=5,
soft_time_limit=2 * 60 * 60, # 2hours
time_limit=2 * 60 * 60 + 5,
soft_time_limit=3 * 60, # 3 minutes
time_limit=3 * 60 + 5,
silo_mode=SiloMode.REGION,
)
@dynamic_sampling_task
Expand Down
10 changes: 5 additions & 5 deletions src/sentry/dynamic_sampling/tasks/recalibrate_orgs.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@
queue="dynamicsampling",
default_retry_delay=5,
max_retries=5,
soft_time_limit=2 * 60 * 60, # 2hours
time_limit=2 * 60 * 60 + 5,
soft_time_limit=1 * 60, # 1 minute
time_limit=1 * 60 + 5,
silo_mode=SiloMode.REGION,
)
@dynamic_sampling_task_with_context(max_task_execution=MAX_TASK_SECONDS)
Expand Down Expand Up @@ -85,8 +85,8 @@ def recalibrate_orgs(context: TaskContext) -> None:
queue="dynamicsampling",
default_retry_delay=5,
max_retries=5,
soft_time_limit=25 * 60,
time_limit=2 * 60 + 5,
soft_time_limit=6 * 60, # 6 minutes
time_limit=6 * 60 + 5,
silo_mode=SiloMode.REGION,
)
@dynamic_sampling_task
Expand Down Expand Up @@ -164,7 +164,7 @@ def recalibrate_org(org_id: OrganizationId, total: int, indexed: int) -> None:
queue="dynamicsampling",
default_retry_delay=5,
max_retries=5,
soft_time_limit=25 * 60,
soft_time_limit=2 * 60,
time_limit=2 * 60 + 5,
silo_mode=SiloMode.REGION,
)
Expand Down
4 changes: 2 additions & 2 deletions src/sentry/dynamic_sampling/tasks/sliding_window_org.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
queue="dynamicsampling",
default_retry_delay=5,
max_retries=5,
soft_time_limit=2 * 60 * 60, # 2 hours
time_limit=2 * 60 * 60 + 5,
soft_time_limit=3 * 60, # 3 minutes
time_limit=3 * 60 + 5,
silo_mode=SiloMode.REGION,
)
@dynamic_sampling_task_with_context(max_task_execution=MAX_TASK_SECONDS)
Expand Down

0 comments on commit dee5394

Please sign in to comment.