Skip to content

Commit

Permalink
Consider all SSL errors as temporary.
Browse files Browse the repository at this point in the history
There are a lot of bug reports from people where various SSL errors cause
a crash but are actually just temporary. On the other hand, we have no
information if this ever revealed a problem where retrying was not the right
choice.

Fixes issue s3ql#87.
Fixes issue s3ql#252.
  • Loading branch information
Nikratio committed Nov 6, 2018
1 parent 98557ef commit 7b82746
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
3 changes: 3 additions & 0 deletions Changes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ UNRELEASED CHANGES
mounted again on the same system without having been mounted
elsewhere.

* S3QL now considers all SSL-related errors as temporary and
automatically retries (instead of bailing out).

2018-10-08, S3QL 2.31

* Object removal now makes more use of parallelism.
Expand Down
12 changes: 6 additions & 6 deletions src/s3ql/backends/s3c.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,12 +170,12 @@ def is_temp_failure(self, exc): #IGNORE:W0613
or exc.status == 408)):
return True

# Temporary workaround for
# https://bitbucket.org/nikratio/s3ql/issues/87 and
# https://bitbucket.org/nikratio/s3ql/issues/252
elif (isinstance(exc, ssl.SSLError) and
(str(exc).startswith('[SSL: BAD_WRITE_RETRY]') or
str(exc).startswith('[SSL: BAD_LENGTH]'))):
# Consider all SSL errors as temporary. There are a lot of bug
# reports from people where various SSL errors cause a crash
# but are actually just temporary. On the other hand, we have
# no information if this ever revealed a problem where retrying
# was not the right choice.
elif isinstance(exc, ssl.SSLError):
return True

return False
Expand Down

0 comments on commit 7b82746

Please sign in to comment.