Skip to content

Conversation

@armenzg
Copy link
Member

@armenzg armenzg commented Nov 24, 2025

Changes included:

  • A Markdown table is added to the docstring describing how to call the retry decorator.
  • It renames RetryError to RetryTaskError to help search the codebase.

Changes included:
* A Markdown table is added to the docstring describing how to call the `retry` decorator.
* It renames `RetryError` to `RetryTaskError` to help search the codebase.
@armenzg armenzg self-assigned this Nov 24, 2025
@armenzg armenzg requested a review from a team as a code owner November 24, 2025 14:35
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Nov 24, 2025
The first set of parameters define how different exceptions are handled.
Raising an error will still report a Sentry event.
| Parameter | Retry | Report | Raise | Description |
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As reference, this renders like this within my IDE:

Image

@functools.wraps(func)
def wrapped(*args, **kwargs):
task_state = current_task()
no_retries_remaining = task_state and not task_state.retries_remaining
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Putting these variables here is to simplify a follow-up PR I have.

from sentry.taskworker.constants import CompressionType
from sentry.taskworker.registry import TaskNamespace
from sentry.taskworker.retry import Retry, RetryError, retry_task
from sentry.taskworker.retry import Retry, RetryTaskError, retry_task
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renaming the variable name makes it easier to search for this.

@codecov
Copy link

codecov bot commented Nov 24, 2025

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
1 1 0 0
View the top 1 failed test(s) by shortest run time
::tests.acceptance.test_link_team
Stack Traces | 0s run time
#x1B[31mImportError while importing test module '.../tests/acceptance/test_link_team.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
#x1B[1m#x1B[.../hostedtoolcache/Python/3.13.1.../x64/lib/python3.13/importlib/__init__.py#x1B[0m:88: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
#x1B[1m#x1B[31mtests/acceptance/test_link_team.py#x1B[0m:6: in <module>
    from sentry.integrations.slack.views.link_team import build_team_linking_url
#x1B[1m#x1B[.../integrations/slack/__init__.py#x1B[0m:4: in <module>
    from .actions.notification import *  # noqa: F401,F403
#x1B[1m#x1B[.../slack/actions/__init__.py#x1B[0m:2: in <module>
    from .notification import SlackNotifyServiceAction
#x1B[1m#x1B[.../slack/actions/notification.py#x1B[0m:26: in <module>
    from sentry.integrations.slack.message_builder.issues import SlackIssuesMessageBuilder
#x1B[1m#x1B[.../slack/message_builder/issues.py#x1B[0m:57: in <module>
    from sentry.notifications.notification_action.utils import should_fire_workflow_actions
#x1B[1m#x1B[.../notifications/notification_action/__init__.py#x1B[0m:42: in <module>
    from .action_handler_registry import (
#x1B[1m#x1B[.../notification_action/action_handler_registry/__init__.py#x1B[0m:8: in <module>
    from .email_handler import EmailActionHandler
#x1B[1m#x1B[.../notification_action/action_handler_registry/email_handler.py#x1B[0m:2: in <module>
    from sentry.notifications.notification_action.utils import execute_via_group_type_registry
#x1B[1m#x1B[.../notifications/notification_action/utils.py#x1B[0m:7: in <module>
    from sentry.notifications.notification_action.registry import (
#x1B[1m#x1B[.../notifications/notification_action/registry.py#x1B[0m:3: in <module>
    from .types import (
#x1B[1m#x1B[.../notifications/notification_action/types.py#x1B[0m:36: in <module>
    from sentry.taskworker.retry import RetryError
#x1B[1m#x1B[31mE   ImportError: cannot import name 'RetryError' from 'sentry.taskworker.retry' (.../sentry/taskworker/retry.py)#x1B[0m#x1B[0m

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

@armenzg armenzg requested review from a team as code owners November 24, 2025 14:45
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From here on, there's only renaming of the variable across the codebase.

Copy link
Member

@markstory markstory left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. I'm not sure that going back to stack grouping for retry errors is the right choice though.

@armenzg
Copy link
Member Author

armenzg commented Nov 24, 2025

Looks good. I'm not sure that going back to stack grouping for retry errors is the right choice though.

I have addressed your feedback and I'm retracting it.

@armenzg armenzg enabled auto-merge (squash) November 24, 2025 15:46
@armenzg armenzg merged commit a580ce1 into master Nov 24, 2025
66 checks passed
@armenzg armenzg deleted the 11_24/only_report_on_last_attempt/armenzg branch November 24, 2025 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants