-
Notifications
You must be signed in to change notification settings - Fork 76
Retry for authentication(getting tokens) #251
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
Conversation
1 similar comment
lewu-msft
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some minor comments for now
tests/test_mock.py
Outdated
| body=body_discovery, | ||
| status=200) | ||
|
|
||
| responses.add(responses.POST, mock_url, body=r'{"error":"' + error_string + r'","error_description":"0","error_codes":[0],"timestamp":"0","trace_id":"0","correlation_id":"0"}' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor: refactor this format a little bit?
azure/datalake/store/retry.py
Outdated
| Response = namedtuple("Response", list(response.keys()) + ['status_code']) | ||
| values = list(response.values()) + [int(http_code.group(1))] | ||
| response = Response( | ||
| *values) # Construct response object with adal exception response and http code |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor: refactor this format a little bit?
lewu-msft
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
let Rahul to double check
This checklist is used to make sure that common guidelines for a pull request are followed.
Description of the change
Add retry for auth method in lib.py that gets the token for the first time. Also moved check_token under the retry code block in call method so we don't fail a call because of transient issues in token refresh.
General Guidelines
Will be done when merge to master
NA