CCOR-13137 - Handle 401 + 403 (w/auth error) Gracefully#121
CCOR-13137 - Handle 401 + 403 (w/auth error) Gracefully#121chrishagglund-ship-it wants to merge 6 commits into
Conversation
…ion, (react to 403 as well, require error string in json response)
mp-orkes
left a comment
There was a problem hiding this comment.
Overall direction might be good (interceptor + backoff), but please address the comments before merge.
The permanent lockout, and the way it's currently handled, is a blocker IMO.
| } | ||
| synchronized (refreshLock) { | ||
| if (tokenRefreshFailures >= MAX_TOKEN_REFRESH_FAILURES) { | ||
| throw new ConductorClientException("Token refresh has failed " + tokenRefreshFailures |
There was a problem hiding this comment.
Once we hit this condition the process can never recover. As already mentioned in this comment.
As it is, this shouldn't be a recoverable Exception. It should be fatal, either a dedicated unchecked error that propagates out, or an explicit process exit.
…ration) - demonstrate token issue locally in different ways
… in a place that makes sense and exit program
|
will now handle the permanent lockout by exiting the program. also enhanced the harness worker to have a basic mode that replicates the simple test worker connect and poll so i could run it conveniently to test that edit: added some tests for the new fatal exception, also did manual testing with the harness worker both full and worker-only modes with bad and valid auth keys, worked as expected. |
CCOR-13137
Rework automatic token refresh to be more like the python implementation, (react to 403 as well, require error string in json response)
Pull Request type
Changes in this PR
Improve handling of errors from requests that were not authorized. Prior work added reactive automatic token refresh however the implementation was naive - this should bring it up to the standards of the preferred implementation from the python sdk.
Implementation requirements:
EXPIRED_TOKENorINVALID_TOKEN, and make an inline attempt to get a fresh token