Skip to content

Commit

Permalink
Now HTTP codes 502,503,504 do retry.
Browse files Browse the repository at this point in the history
  • Loading branch information
ssbarnea committed Jan 13, 2015
1 parent 1e47a9e commit 3557929
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions jira/resilientsession.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,17 @@ def __recoverable(self, response, url, request, counter=1):
response, response.errno, request, url, vars(response), response.__dict__))
if hasattr(response, 'status_code'):
if response.status_code in [502, 503, 504]:
return False
return True
elif response.status_code == 200 and \
len(response.text) == 0 and \
'X-Seraph-LoginReason' in response.headers and \
'AUTHENTICATED_FAILED' in response.headers['X-Seraph-LoginReason']:
# Atlassion horror bug:
# https://answers.atlassian.com/questions/11457054/answers/11975162
logging.warning("Detected")
logging.warning(
"Detected Atlassian bug https://jira.atlassian.com/browse/JRA-41559 ...")
return True
else:
return False

DELAY = 10 * counter
logging.warn("Got recoverable error [%s] from %s %s, retry #%s in %ss" % (
response, request, url, counter, DELAY))
Expand Down

0 comments on commit 3557929

Please sign in to comment.