-
Notifications
You must be signed in to change notification settings - Fork 14
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
Fix Timeout for token retrievals in consequent failures #158
Comments
### Fixed - Logs now correctly print only the Conjur identity without the policy branch prefix. ([#126](#126)) - When authentication fails, the exponential backoff retry is correctly reset so that it will continue to attempt to authenticate until backoff is exhausted. ([#158](#158)) ### Changed - Wait slightly for the client certificate file to exist after login before raising an error. [#119](#119)
### Fixed - Logs now correctly print only the Conjur identity without the policy branch prefix. ([#126](#126)) - When authentication fails, the exponential backoff retry is correctly reset so that it will continue to attempt to authenticate until backoff is exhausted. ([#158](#158)) ### Changed - Wait slightly for the client certificate file to exist after login before raising an error. [#119](#119)
### Fixed - Logs now correctly print only the Conjur identity without the policy branch prefix. ([#126](#126)) - When authentication fails, the exponential backoff retry is correctly reset so that it will continue to attempt to authenticate until backoff is exhausted. ([#158](#158)) ### Changed - Wait slightly for the client certificate file to exist after login before raising an error. [#119](#119)
This version introduces some changes that we can benefit from, especially these: - Errors in the certificate injection process on login are now printed to the client logs. [cyberark/conjur-authn-k8s-client#/170](cyberark/conjur-authn-k8s-client#170) - When authentication fails, the exponential backoff retry is correctly reset so that it will continue to attempt to authenticate until backoff is exhausted. [cyberark/conjur-authn-k8s-client#158](cyberark/conjur-authn-k8s-client#158) - Wait slightly for the client certificate file to exist after login before raising an error. [cyberark/conjur-authn-k8s-client#119](cyberark/conjur-authn-k8s-client#119)
This version introduces some changes that we can benefit from, especially these: - Errors in the certificate injection process on login are now printed to the client logs. [cyberark/conjur-authn-k8s-client#/170](cyberark/conjur-authn-k8s-client#170) - When authentication fails, the exponential backoff retry is correctly reset so that it will continue to attempt to authenticate until backoff is exhausted. [cyberark/conjur-authn-k8s-client#158](cyberark/conjur-authn-k8s-client#158) - Wait slightly for the client certificate file to exist after login before raising an error. [cyberark/conjur-authn-k8s-client#119](cyberark/conjur-authn-k8s-client#119)
This version introduces some changes that we can benefit from, especially these: - Errors in the certificate injection process on login are now printed to the client logs. [cyberark/conjur-authn-k8s-client#/170](cyberark/conjur-authn-k8s-client#170) - When authentication fails, the exponential backoff retry is correctly reset so that it will continue to attempt to authenticate until backoff is exhausted. [cyberark/conjur-authn-k8s-client#158](cyberark/conjur-authn-k8s-client#158) - Wait slightly for the client certificate file to exist after login before raising an error. [cyberark/conjur-authn-k8s-client#119](cyberark/conjur-authn-k8s-client#119)
This version introduces some changes that we can benefit from, especially these: - Errors in the certificate injection process on login are now printed to the client logs. [cyberark/conjur-authn-k8s-client#/170](cyberark/conjur-authn-k8s-client#170) - When authentication fails, the exponential backoff retry is correctly reset so that it will continue to attempt to authenticate until backoff is exhausted. [cyberark/conjur-authn-k8s-client#158](cyberark/conjur-authn-k8s-client#158) - Wait slightly for the client certificate file to exist after login before raising an error. [cyberark/conjur-authn-k8s-client#119](cyberark/conjur-authn-k8s-client#119)
This version introduces some changes that we can benefit from, especially these: - Errors in the certificate injection process on login are now printed to the client logs. [cyberark/conjur-authn-k8s-client#/170](cyberark/conjur-authn-k8s-client#170) - When authentication fails, the exponential backoff retry is correctly reset so that it will continue to attempt to authenticate until backoff is exhausted. [cyberark/conjur-authn-k8s-client#158](cyberark/conjur-authn-k8s-client#158) - Wait slightly for the client certificate file to exist after login before raising an error. [cyberark/conjur-authn-k8s-client#119](cyberark/conjur-authn-k8s-client#119)
This version introduces some changes that we can benefit from, especially these: - Errors in the certificate injection process on login are now printed to the client logs. [cyberark/conjur-authn-k8s-client#/170](cyberark/conjur-authn-k8s-client#170) - When authentication fails, the exponential backoff retry is correctly reset so that it will continue to attempt to authenticate until backoff is exhausted. [cyberark/conjur-authn-k8s-client#158](cyberark/conjur-authn-k8s-client#158) - Wait slightly for the client certificate file to exist after login before raising an error. [cyberark/conjur-authn-k8s-client#119](cyberark/conjur-authn-k8s-client#119)
fixed by #157 |
i don't think the logic is captured in the docs. Our authn-k8s docs are lacking a lot of details on the flow. What are you missing here? I was about to write the fix but it won't be different than what is explained in the description above and in the PR description. CAn you please elaborate. on what is not clear? |
@orenbm: I just find the description a little confusing. For example, "expBackoff clock" seems like an implementation detail. The clock isn't exposed to users, right? And the rest of the description is written around this clock. Why would someone care about this fix? |
Summary
After we get the access token into the shared volume, we hit the reset button on the expBackoff clock
before waiting the token refresh timeout. This means that the next
interval will start 6 minutes (by default) into the clock and only one
cycle will run (as we exceed the max elapsed time of 2 minutes).
We should reset the clock after the timeout waits to ensure that the next cycle
will run for at most 2 minutes as intended.
Here is a log that shows the failure, in which we run only once before crashing (logs are written from bottom to top):
You can see that we start a new wait (CAKC013I) and this happens after we run expBackoff.Reset(). So we are supposed to run a new backoff cycle that will run for up to 2 minutes before crashing. However, we run only one time and finish the backoff before writing CAKC031E Retransmission backoff exhausted to the log.
Steps to Reproduce
Steps to reproduce the behavior:
Expected Results
The authenticator retries to authenticate
Actual Results (including error logs, if applicable)
The authenticator exists with failure after one try
The text was updated successfully, but these errors were encountered: