Conversation
- Do not cancel ongoing refresh - Better logging in case of error
| const ( | ||
| requestTimeout = 30 * time.Second | ||
| ) |
There was a problem hiding this comment.
Do we need to add a timeout here? It's always better to let the caller do this IMO.
There was a problem hiding this comment.
I don't agree, I don't trust the caller to set a deadline and I don't want this to hang. I'm still honouring the caller's context by cancelling when they want, but I don't see why this should be the caller's responsibility to be sure my HTTP client will not block infinitely.
Co-authored-by: Edoardo Spadolini <edoardo.spadolini@goteleport.com>
There was a problem hiding this comment.
Should we also prevent multiple replicas of auth server trying to refresh the same plugin/credentials?
from my understanding, every auth server replica runs the slack plugin and tries to revalidate the credentials
It also seems the case that the plugin manager shutsdown every single plugin on credentials refresh as per:
- https://github.com/gravitational/teleport.e/blob/51394a756619197fedd762a5726e1f0bfde7d0a9/lib/plugins/manager.go#L331-L333
- https://github.com/gravitational/teleport.e/blob/51394a756619197fedd762a5726e1f0bfde7d0a9/lib/plugins/instance/instance.go#L33-L36
This means that after the first update, all plugins will eventually synchronize and refresh the credentials at the same time
|
@hugoShaka See the table below for backport results.
|
* Slack plugin hardening - Do not cancel ongoing refresh - Better logging in case of error * fixup! Slack plugin hardening * fixup! fixup! Slack plugin hardening * Apply suggestions from code review Co-authored-by: Edoardo Spadolini <edoardo.spadolini@goteleport.com> * address feedback * fixup! address feedback --------- Co-authored-by: Edoardo Spadolini <edoardo.spadolini@goteleport.com>
* Slack plugin hardening - Do not cancel ongoing refresh - Better logging in case of error * fixup! Slack plugin hardening * fixup! fixup! Slack plugin hardening * Apply suggestions from code review Co-authored-by: Edoardo Spadolini <edoardo.spadolini@goteleport.com> * address feedback * fixup! address feedback --------- Co-authored-by: Edoardo Spadolini <edoardo.spadolini@goteleport.com>
* Slack plugin hardening - Do not cancel ongoing refresh - Better logging in case of error * fixup! Slack plugin hardening * fixup! fixup! Slack plugin hardening * Apply suggestions from code review * address feedback * fixup! address feedback --------- Co-authored-by: Edoardo Spadolini <edoardo.spadolini@goteleport.com>
This PR improves how we handle issues during Slack token renewal, or renewal during shutdown. It makes sure we try everything possible to finish the renewal. The server can still crash/be ungracefully terminated, but at least we support graceful termination better.
Twin
ePR: https://github.com/gravitational/teleport.e/pull/7951This PR does the following changes:
More context in Slack:
Changelog: Improved robustness of the Slack hosted plugin to reduce the likeliness of failed token refresh when experiencing external disruption.