unnecessary sleep in swiftclient retry on 401

Bug #1386859 reported by clayg
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
python-swiftclient
Confirmed
Low
Geronimo Orozco

Bug Description

When you get a 401 your swiftclient.client.Connection will retry the request if the retries param is greater than 0 (the default is 5) - but because it shares the backoff handling with other retry cases like 5XX it will also call sleep first.

I think most of the time a 401 does not require an exponential backoff to request an updated token and retry the request, it's unnecessary and unexpected.

I'd like to see the sleep call bypassed on the 401 retry case.

Revision history for this message
Thierry Titcheu Chekam (thierry-tct) wrote :

Yes I agree, No need to retry when the client is not Unauthorized, it is waste of time.
Can just return after first attempt..

Changed in swift:
assignee: nobody → Geronimo Orozco (gorozco)
Revision history for this message
clayg (clay-gerrard) wrote :

well the second attempt will also do a reauth first, which is likely to succeed - so it's not quite as simple as just "return the 401" - we want to get a fresh token and retry (and I think we already will only retry 401 once) - we just don't need to wait around to do it.

Tim Burke (1-tim-z)
affects: swift → python-swiftclient
Changed in python-swiftclient:
status: New → Confirmed
importance: Undecided → Low
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.