Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Source Pinterest: no backoff strategy when rate limit is exceeded. #8814

Closed
alafanechere opened this issue Dec 15, 2021 · 2 comments · Fixed by #16161
Closed

🐛 Source Pinterest: no backoff strategy when rate limit is exceeded. #8814

alafanechere opened this issue Dec 15, 2021 · 2 comments · Fixed by #16161

Comments

@alafanechere
Copy link
Contributor

Environment

  • Airbyte version: 0.32.0-alpha
  • OS Version / Instance:Google cloud VM
  • Deployment: Docker
  • Source Connector and version: Pinterest 0.1.0
  • Severity: Critical
  • Step where error happened: SyncJob

Current Behavior

When rate limit is exceeded (on CampaignAnalytics stream) the sync stops for this stream and there's no retry nor backoff attempts made.

The should_retry method handles the 429 HTTP code only for logging purpose but does not retry on it which looks strange to me:

    def should_retry(self, response: requests.Response) -> bool:
        if response.status_code == 429:
            self.logger.error(f"For stream {self.name} rate limit exceeded.")
            setattr(self, "raise_on_http_errors", False)
        return 500 <= response.status_code < 600

Expected Behavior

Exponential backoff to handle rate limits on Pinterest API

Logs

Logs are provided by Matt Fleshman who raised this error on Slack.

logs-904-0.txt

Steps to Reproduce

  1. Create a connection with Pinterest as source
  2. Sync a CampaignAnalytics stream that makes more than 1000 calls (the limit is 1000calls / day).
@alafanechere alafanechere added type/bug Something isn't working area/connectors Connector related issues community labels Dec 15, 2021
@mattfleshman
Copy link

Thank you! Two more details: 1. I believe the rate limiting also happens on the AdGroupAnalytics stream. 2. We are using Advanced API Access and our rate limit should be 1000 calls a minute.

@lgomezm
Copy link
Contributor

lgomezm commented Aug 31, 2022

Here's a PR to fix this issue: #16161

@lazebnyi lazebnyi linked a pull request Sep 6, 2022 that will close this issue
37 tasks
@lazebnyi lazebnyi assigned arsenlosenko and bazarnov and unassigned lazebnyi Sep 6, 2022
@bazarnov bazarnov moved this from Backlog (unscoped) to In review (internal) in GL Roadmap Sep 6, 2022
Repository owner moved this from In Progress to Unclaimed in Community Contributors Sep 6, 2022
@YowanR YowanR moved this from Unclaimed to Done in Community Contributors Sep 6, 2022
@YowanR YowanR moved this from Done to In Progress in Community Contributors Sep 6, 2022
@YowanR YowanR moved this from In Progress to Done in Community Contributors Sep 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Status: Done
Status: In review (internal)
Development

Successfully merging a pull request may close this issue.

9 participants