-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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 Zendesk Support: handle 429 response behavior when retrying #19967
🐛 Source Zendesk Support: handle 429 response behavior when retrying #19967
Conversation
@@ -270,7 +270,7 @@ def _retry( | |||
if original_exception: | |||
raise original_exception | |||
raise DefaultBackoffException(request=request, response=response) | |||
if response: | |||
if response is not None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@BenoitHugonnard can you explain how this will solve the problem with 429? The change you made doesn't affect any logic.
if response
is equal to if response is not None
If I'm not wrong :p
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually it is the key !
The issue we currently have, is when Zendesk responds with a 429 for organizations, the retry that can only happen if response
is never called so Airbyte doesn't wait x seconds before retrying so Uncaught Error (see the associated issue).
The issue is that when we bool check the 429 response we get false but the content is not empty (we still get the headers having the info for the x-retry-after).
If we do this check you'll see :
for i in range(15):
resp = requests.get(
url="https://*****.zendesk.com/api/v2/organizations?start_time=946684800&page=1011",
headers=headers,
auth=auth
)
status_code = resp.status_code
is_response = True if resp is not None else False
print(status_code, is_response)
>>>200 True
200 True
200 True
200 True
200 True
200 True
200 True
200 True
200 True
200 True
429 True
429 True
429 True
429 True
429 True
Between this and the initial description of the PR, I only changed what I changed in the PR if response
turns into if response is not None
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the info @BenoitHugonnard
@bazarnov can you do the final review for this change in Support Zendesk GA connector? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make sense, actually! Nice catch!
We didn't face this before, since we don't have lots of data in our sandbox @marcosmarxm
But, still, the version should be bumped and change log should be updated, as well as acceptance tests should pass.
@marcosmarxm will you assist with this?
/test connector=connectors/source-zendesk-support
|
/test connector=connectors/source-zendesk-support
Build PassedTest summary info:
|
So as this is my first PR, not really sure if I need to do stuff. I don't mind, I'm just not aware of what's expected. |
/publish connector=connectors/source-zendesk-support
if you have connectors that successfully published but failed definition generation, follow step 4 here |
Is there more left to do @marcosmarxm? Man it made me happy to see this PR. Excited for this to be released! 🙌 I attempted to develop it myself but I could not even get the dev environment to work locally #noob |
hey @BenoitHugonnard and @marcosmarxm , we were affected by this issue with the Zendesk connector failing randomly with 429. However after updating to the latest version the sync just hangs. It probably keeps retrying in the background ? |
@validumitru Hi, have a look at the latest posts in this thread #14253 |
What
Currently, when trying to sync over 100k Organization we encounter a 429 error without retrying (Associated issue).
How
This is happening because over 100k organizations, we are querying pages > 1000 and Zendesk has a different API rates for those pages (10 per minutes instead of 700).
I was able to reproduce the issue locally with my company and by just executing the following script
Recommended reading order
x.java
y.python
🚨 User Impact 🚨
Are there any breaking changes? What is the end result perceived by the user? If yes, please merge this PR with the 🚨🚨 emoji so changelog authors can further highlight this if needed.
Pre-merge Checklist
Expand the relevant checklist and delete the others.
New Connector
Community member or Airbyter
airbyte_secret
./gradlew :airbyte-integrations:connectors:<name>:integrationTest
.README.md
bootstrap.md
. See description and examplesdocs/integrations/<source or destination>/<name>.md
including changelog. See changelog exampledocs/integrations/README.md
airbyte-integrations/builds.md
Airbyter
If this is a community PR, the Airbyte engineer reviewing this PR is responsible for the below items.
/test connector=connectors/<name>
command is passing/publish
command described hereUpdating a connector
Community member or Airbyter
airbyte_secret
./gradlew :airbyte-integrations:connectors:<name>:integrationTest
.README.md
bootstrap.md
. See description and examplesdocs/integrations/<source or destination>/<name>.md
including changelog. See changelog exampleAirbyter
If this is a community PR, the Airbyte engineer reviewing this PR is responsible for the below items.
/test connector=connectors/<name>
command is passing/publish
command described hereConnector Generator
-scaffold
in their name) have been updated with the latest scaffold by running./gradlew :airbyte-integrations:connector-templates:generator:testScaffoldTemplates
then checking in your changesTests
Unit
Put your unit tests output here.
Integration
Put your integration tests output here.
Acceptance
Put your acceptance tests output here.