Skip to content

Commit 56b1d54

Browse files
authored
fix(aci): Report Snuba exceptions as warnings and retry (#94582)
Snuba errors are expected and should not be treated as errors; when they occur, we'd like to retry. We log them as warnings before retry so we still have record of them; if we used `@retry` for this, it'd report them as high priority and we'd like to avoid that in this context.
1 parent a9e75ed commit 56b1d54

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/sentry/workflow_engine/processors/delayed_workflow.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,12 @@
3232
from sentry.tasks.post_process import should_retry_fetch
3333
from sentry.taskworker.config import TaskworkerConfig
3434
from sentry.taskworker.namespaces import issues_tasks
35-
from sentry.taskworker.retry import Retry
35+
from sentry.taskworker.retry import Retry, retry_task
3636
from sentry.utils import metrics
3737
from sentry.utils.iterators import chunked
3838
from sentry.utils.registry import NoRegistrationExistsError
3939
from sentry.utils.retries import ConditionalRetryPolicy, exponential_delay
40+
from sentry.utils.snuba import SnubaError
4041
from sentry.workflow_engine.handlers.condition.event_frequency_query_handlers import (
4142
BaseEventFrequencyQueryHandler,
4243
GroupValues,
@@ -817,7 +818,12 @@ def process_delayed_workflows(
817818
},
818819
)
819820

820-
condition_group_results = get_condition_group_results(condition_groups)
821+
try:
822+
condition_group_results = get_condition_group_results(condition_groups)
823+
except SnubaError:
824+
# We expect occasional errors, so we report as warning and retry.
825+
logger.warning("delayed_workflow.snuba_error", exc_info=True)
826+
retry_task()
821827

822828
logger.info(
823829
"delayed_workflow.condition_group_results",

0 commit comments

Comments
 (0)