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 Zendesk Chat: passing timeout in request to prevent a stuck connection #12883

Conversation

RobertoBonnet
Copy link
Contributor

@RobertoBonnet RobertoBonnet commented May 16, 2022

What

Resolving the problem that occurs when we are getting to much rows from Zendesk chat

#12591

How

Setting a timeout for requests.

Community member or Airbyter

  • Community member? Grant edit access to maintainers (instructions)
  • Secrets in the connector's spec are annotated with airbyte_secret
  • Unit & integration tests added and passing. Community members, please provide proof of success locally e.g: screenshot or copy-paste unit, integration, and acceptance test output. To run acceptance tests for a Python connector, follow instructions in the README. For java connectors run ./gradlew :airbyte-integrations:connectors:<name>:integrationTest.
  • Code reviews completed
  • Documentation updated
    • Connector's README.md
    • Connector's bootstrap.md. See description and examples
    • docs/SUMMARY.md
    • docs/integrations/<source or destination>/<name>.md including changelog. See changelog example
    • docs/integrations/README.md
    • airbyte-integrations/builds.md
  • PR name follows PR naming conventions

Airbyter

If this is a community PR, the Airbyte engineer reviewing this PR is responsible for the below items.

  • Create a non-forked branch based on this PR and test the below items on it
  • Build is successful
  • If new credentials are required for use in CI, add them to GSM. Instructions.
  • /test connector=connectors/<name> command is passing
  • New Connector version released on Dockerhub by running the /publish command described here
  • After the connector is published, connector added to connector index as described here
  • Seed specs have been re-generated by building the platform and committing the changes to the seed spec files, as described here
Updating a connector

Community member or Airbyter

  • Grant edit access to maintainers (instructions)
  • Secrets in the connector's spec are annotated with airbyte_secret
  • Unit & integration tests added and passing. Community members, please provide proof of success locally e.g: screenshot or copy-paste unit, integration, and acceptance test output. To run acceptance tests for a Python connector, follow instructions in the README. For java connectors run ./gradlew :airbyte-integrations:connectors:<name>:integrationTest.
  • Code reviews completed
  • Documentation updated
    • Connector's README.md
    • Connector's bootstrap.md. See description and examples
    • Changelog updated in docs/integrations/<source or destination>/<name>.md including changelog. See changelog example
  • PR name follows PR naming conventions

Airbyter

If this is a community PR, the Airbyte engineer reviewing this PR is responsible for the below items.

  • Create a non-forked branch based on this PR and test the below items on it
  • Build is successful
  • If new credentials are required for use in CI, add them to GSM. Instructions.
  • /test connector=connectors/<name> command is passing
  • New Connector version released on Dockerhub and connector version bumped by running the /publish command described here
Connector Generator
  • Issue acceptance criteria met
  • PR name follows PR naming conventions
  • If adding a new generator, add it to the list of scaffold modules being tested
  • The generator test modules (all connectors with -scaffold in their name) have been updated with the latest scaffold by running ./gradlew :airbyte-integrations:connector-templates:generator:testScaffoldTemplates then checking in your changes
  • Documentation which references the generator is updated as needed

Tests

Unit

Put your unit tests output here.

Integration

Put your integration tests output here.

Acceptance

Put your acceptance tests output here.

@github-actions github-actions bot added the area/connectors Connector related issues label May 16, 2022
@CLAassistant
Copy link

CLAassistant commented May 16, 2022

CLA assistant check
All committers have signed the CLA.

@harshithmullapudi
Copy link
Contributor

@RobertoBonnet thanks for the contribution. Can you share the screenshot of sourceAcceptanceTests and also follow these https://docs.airbyte.com/connector-development/#updating-an-existing-connector

@harshithmullapudi harshithmullapudi self-requested a review May 17, 2022 07:07
@harshithmullapudi harshithmullapudi self-assigned this May 17, 2022
@RobertoBonnet
Copy link
Contributor Author

@harshithmullapudi Is this?
image

@RobertoBonnet
Copy link
Contributor Author

/test connector=connectors/source-zendesk-chat

@marcosmarxm
Copy link
Member

@bruno-nirello maybe this PR can help you debugging the long running connection with Zendesk.

@marcosmarxm
Copy link
Member

marcosmarxm commented May 17, 2022

/test connector=connectors/source-zendesk-chat

🕑 connectors/source-zendesk-chat https://github.com/airbytehq/airbyte/actions/runs/2339027745
❌ connectors/source-zendesk-chat https://github.com/airbytehq/airbyte/actions/runs/2339027745
🐛 https://gradle.com/s/4npukcjblwgmy
Python short test summary info:

=========================== short test summary info ============================
FAILED test_core.py::TestConnection::test_check[inputs0] - docker.errors.Cont...
FAILED test_core.py::TestConnection::test_check[inputs1] - docker.errors.Cont...
FAILED test_core.py::TestConnection::test_check[inputs2] - docker.errors.Cont...
FAILED test_core.py::TestConnection::test_check[inputs3] - docker.errors.Cont...
FAILED test_core.py::TestDiscovery::test_discover[inputs0] - docker.errors.Co...
FAILED test_core.py::TestDiscovery::test_discover[inputs1] - docker.errors.Co...
FAILED test_core.py::TestDiscovery::test_discover[inputs2] - docker.errors.Co...
ERROR test_core.py::TestSpec::test_config_match_spec[inputs0] - docker.errors...
ERROR test_core.py::TestSpec::test_match_expected[inputs0] - docker.errors.Co...
ERROR test_core.py::TestSpec::test_docker_env[inputs0] - docker.errors.Contai...
ERROR test_core.py::TestSpec::test_oneof_usage[inputs0] - docker.errors.Conta...
ERROR test_core.py::TestSpec::test_defined_refs_exist_in_json_spec_file[inputs0]
ERROR test_core.py::TestSpec::test_oauth_flow_parameters[inputs0] - docker.er...
ERROR test_core.py::TestDiscovery::test_defined_cursors_exist_in_schema[inputs0]
ERROR test_core.py::TestDiscovery::test_defined_cursors_exist_in_schema[inputs1]
ERROR test_core.py::TestDiscovery::test_defined_cursors_exist_in_schema[inputs2]
ERROR test_core.py::TestDiscovery::test_defined_refs_exist_in_schema[inputs0]
ERROR test_core.py::TestDiscovery::test_defined_refs_exist_in_schema[inputs1]
ERROR test_core.py::TestDiscovery::test_defined_refs_exist_in_schema[inputs2]
ERROR test_core.py::TestDiscovery::test_defined_keyword_exist_in_schema[inputs0-allOf]
ERROR test_core.py::TestDiscovery::test_defined_keyword_exist_in_schema[inputs0-not]
ERROR test_core.py::TestDiscovery::test_defined_keyword_exist_in_schema[inputs1-allOf]
ERROR test_core.py::TestDiscovery::test_defined_keyword_exist_in_schema[inputs1-not]
ERROR test_core.py::TestDiscovery::test_defined_keyword_exist_in_schema[inputs2-allOf]
ERROR test_core.py::TestDiscovery::test_defined_keyword_exist_in_schema[inputs2-not]
ERROR test_core.py::TestDiscovery::test_primary_keys_exist_in_schema[inputs0]
ERROR test_core.py::TestDiscovery::test_primary_keys_exist_in_schema[inputs1]
ERROR test_core.py::TestDiscovery::test_primary_keys_exist_in_schema[inputs2]
ERROR test_core.py::TestBasicRead::test_read[inputs0] - docker.errors.Contain...
ERROR test_core.py::TestBasicRead::test_read[inputs1] - docker.errors.Contain...
ERROR test_full_refresh.py::TestFullRefresh::test_sequential_reads[inputs0]
ERROR test_incremental.py::TestIncremental::test_two_sequential_reads[inputs0]
ERROR test_incremental.py::TestIncremental::test_state_with_abnormally_large_values[inputs0]
=================== 7 failed, 4 passed, 26 errors in 17.13s ====================

@marcosmarxm
Copy link
Member

@RobertoBonnet could add the link to Zendesk documentation about the timeout parameter? Did you have a connection with more than 100k records did you try it with dev image?

@marcosmarxm marcosmarxm changed the title Passing timeout in request to prevent a stuck connection Source Zendesk Chat: passing timeout in request to prevent a stuck connection May 17, 2022
@RobertoBonnet
Copy link
Contributor Author

@marcosmarxm I didn't find anything in the documentation regarding the timeout, but in my tests I saw that it was happening. Apparently there is no timeout on either the server or the client side.

Here's the print of what I processed with this image
image

@RobertoBonnet
Copy link
Contributor Author

On a fresh install I am getting pendulum error. I decided to update to "pendulum >= 2,<3" and it worked. Should I do this in this PR?

image

@RobertoBonnet
Copy link
Contributor Author

RobertoBonnet commented May 18, 2022

Look at theses logs. I tried with a simple table to make it easy to debug

original-requirements-logs-402.txt
upgraded-pendulum-requirements-logs-402.txt

@harshithmullapudi
Copy link
Contributor

harshithmullapudi commented May 20, 2022

/test connector=connectors/source-zendesk-chat

🕑 connectors/source-zendesk-chat https://github.com/airbytehq/airbyte/actions/runs/2356949185
❌ connectors/source-zendesk-chat https://github.com/airbytehq/airbyte/actions/runs/2356949185
🐛 https://gradle.com/s/o3zun5nlpdmeu
Python short test summary info:

=========================== short test summary info ============================
FAILED test_core.py::TestSpec::test_oneof_usage[inputs0] - AssertionError: Th...
SKIPPED [1] ../usr/local/lib/python3.9/site-packages/source_acceptance_test/tests/test_incremental.py:23: `future_state_path` not specified, skipping
=================== 1 failed, 38 passed, 1 skipped in 45.11s ===================

@marcosmarxm
Copy link
Member

@RobertoBonnet looks the error is related to spec.json file do you mind correcting it?

@RobertoBonnet
Copy link
Contributor Author

@marcosmarxm Is there any way to run similar test locally? I'll check it

@marcosmarxm
Copy link
Member

you can run ./gradlew airbyte-integrations:connectors:source-zendesk-chat:integrationTest

@harshithmullapudi
Copy link
Contributor

@RobertoBonnet any update here?

@jablonskijakub
Copy link
Contributor

@RobertoBonnet have you tested it for ticket_metrics in Zendesk Support as well?

@RobertoBonnet
Copy link
Contributor Author

@harshithmullapudi I was working with zendesk support. I'll check chat now.

@jablonskijakub Yes, but the problem with support is other. I have commented here #12591

@RobertoBonnet
Copy link
Contributor Author

@marcosmarxm @harshithmullapudi Can you run the test again?

@marcosmarxm
Copy link
Member

marcosmarxm commented May 23, 2022

/test connector=connectors/source-zendesk-chat

🕑 connectors/source-zendesk-chat https://github.com/airbytehq/airbyte/actions/runs/2373978675
✅ connectors/source-zendesk-chat https://github.com/airbytehq/airbyte/actions/runs/2373978675
Python tests coverage:

Name                                                 Stmts   Miss  Cover
------------------------------------------------------------------------
source_acceptance_test/utils/__init__.py                 6      0   100%
source_acceptance_test/tests/__init__.py                 4      0   100%
source_acceptance_test/__init__.py                       2      0   100%
source_acceptance_test/tests/test_full_refresh.py       52      2    96%
source_acceptance_test/utils/asserts.py                 37      2    95%
source_acceptance_test/config.py                        74      6    92%
source_acceptance_test/utils/json_schema_helper.py     105     13    88%
source_acceptance_test/utils/common.py                  80     17    79%
source_acceptance_test/utils/compare.py                 62     23    63%
source_acceptance_test/tests/test_core.py              285    106    63%
source_acceptance_test/base.py                          10      4    60%
source_acceptance_test/utils/connector_runner.py       110     48    56%
source_acceptance_test/tests/test_incremental.py        69     38    45%
------------------------------------------------------------------------
TOTAL                                                  896    259    71%

@harshithmullapudi
Copy link
Contributor

harshithmullapudi commented May 25, 2022

/publish connector=connectors/source-zendesk-chat auto-bump-version=false

🕑 connectors/source-zendesk-chat https://github.com/airbytehq/airbyte/actions/runs/2383574279
🚀 Successfully published connectors/source-zendesk-chat
✅ connectors/source-zendesk-chat https://github.com/airbytehq/airbyte/actions/runs/2383574279

@github-actions github-actions bot added the area/documentation Improvements or additions to documentation label May 25, 2022
@harshithmullapudi harshithmullapudi merged commit 15950df into airbytehq:master May 25, 2022
@RobertoBonnet RobertoBonnet deleted the zendesk-chat-prevent-a-stuck-connection branch May 27, 2022 15:57
jscottpolevault pushed a commit to jscottpolevault/airbyte that referenced this pull request Jun 1, 2022
…nnection (airbytehq#12883)

* setting a timeout in client side

* upgraded version

* upgraded pendulum lib

* fix spec like docs

* chore: bump version in source definitions

* chore: update seed file

Co-authored-by: Harshith Mullapudi <harshithmullapudi@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/connectors Connector related issues area/documentation Improvements or additions to documentation community
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants