Skip to content

Commit

Permalink
Source File: add retry on SSHException('Error reading SSH protocol ba…
Browse files Browse the repository at this point in the history
…nner') - 2 (#26210)

Signed-off-by: Sergey Chvalyuk <grubberr@gmail.com>
  • Loading branch information
grubberr committed May 17, 2023
1 parent 30869b5 commit 50c7cb4
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 8 deletions.
4 changes: 2 additions & 2 deletions airbyte-integrations/connectors/source-file-secure/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM airbyte/source-file:0.3.7
FROM airbyte/source-file:0.3.8

WORKDIR /airbyte/integration_code
COPY source_file_secure ./source_file_secure
Expand All @@ -9,5 +9,5 @@ RUN pip install .
ENV AIRBYTE_ENTRYPOINT "python /airbyte/integration_code/main.py"
ENTRYPOINT ["python", "/airbyte/integration_code/main.py"]

LABEL io.airbyte.version=0.3.7
LABEL io.airbyte.version=0.3.8
LABEL io.airbyte.name=airbyte/source-file-secure
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ data:
connectorSubtype: file
connectorType: source
definitionId: 778daa7c-feaf-4db6-96f3-70fd645acc77
dockerImageTag: 0.3.7
dockerImageTag: 0.3.8
dockerRepository: airbyte/source-file-secure
githubIssueLabel: source-file
icon: file.svg
Expand Down
2 changes: 1 addition & 1 deletion airbyte-integrations/connectors/source-file/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ COPY source_file ./source_file
ENV AIRBYTE_ENTRYPOINT "python /airbyte/integration_code/main.py"
ENTRYPOINT ["python", "/airbyte/integration_code/main.py"]

LABEL io.airbyte.version=0.3.7
LABEL io.airbyte.version=0.3.8
LABEL io.airbyte.name=airbyte/source-file
4 changes: 2 additions & 2 deletions airbyte-integrations/connectors/source-file/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ data:
connectorSubtype: file
connectorType: source
definitionId: 778daa7c-feaf-4db6-96f3-70fd645acc77
dockerImageTag: 0.3.7
dockerImageTag: 0.3.8
dockerRepository: airbyte/source-file
githubIssueLabel: source-file
icon: file.svg
Expand All @@ -14,7 +14,7 @@ data:
registries:
cloud:
dockerRepository: airbyte/source-file-secure
dockerImageTag: 0.3.7 # Dont forget to publish source-file-secure as well when updating this.
dockerImageTag: 0.3.8 # Dont forget to publish source-file-secure as well when updating this.
enabled: true
oss:
enabled: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def close(self):

def backoff_giveup(self, error):
# https://github.com/airbytehq/oncall/issues/1954
if isinstance(error, SSHException) and str(error) == "Error reading SSH protocol banner":
if isinstance(error, SSHException) and str(error).startswith("Error reading SSH protocol banner"):
# We need to clear smart_open internal _SSH cache from the previous attempt, otherwise:
# SSHException('SSH session not active')
# will be raised
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ def patched_open(self):
nonlocal call_count
call_count += 1
if call_count < 7:
raise SSHException("Error reading SSH protocol banner")
raise SSHException("Error reading SSH protocol banner[Errno 104] Connection reset by peer")
return result

sleep_mock = mocker.patch("time.sleep")
Expand Down
1 change: 1 addition & 0 deletions docs/integrations/sources/file.md
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ In order to read large files from a remote location, this connector uses the [sm

| Version | Date | Pull Request | Subject |
|:--------|:-----------|:---------------------------------------------------------|:--------------------------------------------------------------------------------------------------------|
| 0.3.8 | 2023-05-17 | [26210](https://github.com/airbytehq/airbyte/pull/26210) | Bugfix for https://github.com/airbytehq/airbyte/pull/26115 |
| 0.3.7 | 2023-05-16 | [26131](https://github.com/airbytehq/airbyte/pull/26131) | Re-release source-file to be in sync with source-file-secure |
| 0.3.6 | 2023-05-16 | [26115](https://github.com/airbytehq/airbyte/pull/26115) | Add retry on SSHException('Error reading SSH protocol banner') |
| 0.3.5 | 2023-05-16 | [26117](https://github.com/airbytehq/airbyte/pull/26117) | Check if reader options is a valid JSON object |
Expand Down

0 comments on commit 50c7cb4

Please sign in to comment.