Skip to content

Slack API rate limit errors due to hardcoded retry count #35661

@marcosmamorim

Description

@marcosmamorim

Bug description

When fetching Slack channels for Alerts & Reports, the code uses a hardcoded max_retry_count=2 in the RateLimitErrorRetryHandler. This causes failures when Slack API returns HTTP 429 (rate limit):

POST https://slack.com/api/conversations.list - HTTP Error 429: Too Many Requests

Reproduction steps:

  1. Configure Slack integration with SLACK_API_TOKEN
  2. Enable ALERT_REPORTS feature flag
  3. Create an Alert/Report with Slack notification
  4. Try to select a channel from the dropdown
  5. Error occurs after 2 retry attempts

Expected behavior:
Retry count should be configurable to handle rate limits in different workspace sizes.

Root cause:
superset/utils/slack.py line 54:

rate_limit_handler = RateLimitErrorRetryHandler(max_retry_count=2)  # Hardcoded

Screenshots/recordings

N/A

Superset version

master / latest-dev

Python version

3.11

Node version

16

Browser

Chrome

Additional context

  • More noticeable in large workspaces (10k+ channels) due to higher number of paginated requests
  • Feature flag enabled: ALERT_REPORTS
  • Fix available in PR #35622

Checklist

  • I have searched Superset docs and Slack and didn't find a solution to my problem.
  • I have searched the GitHub issue tracker and didn't find a similar bug report.
  • I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section.

Metadata

Metadata

Assignees

No one assigned

    Labels

    alert-reportsNamespace | Anything related to the Alert & Reports feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions