Skip to content
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

connector: Use a separate goroutine for update destination #3391

Merged
merged 2 commits into from
Oct 6, 2022

Conversation

dnephin
Copy link
Contributor

@dnephin dnephin commented Oct 4, 2022

This should allow us to have different life-cycles for each of these operations.

Comment on lines 217 to 221
if err := syncDestination(con); err != nil {
logging.Errorf("failed to update destination in infra: %v", err)
}
// TODO: should this exit after the first successful update?
wait(ctx, 30*time.Second)
Copy link
Contributor Author

@dnephin dnephin Oct 4, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering how this should work. I think there's a few different cases:

  1. the sync failed - we should probably retry pretty quickly, but maybe with some exponential backoff (start at 2s retry, with a max backoff of 1 minute?)
  2. the sync was successful, but there's no Connection.URL yet (relevant once we merge feat(connector): create destination as soon as possible #3384) - probably the same behaviour as above. Short delay with some backoff
  3. the sync was successful, and there is a Connection.URL - do we actually want to continue to check for updates in this scenario? I guess it needs to detect new namespaces and roles being added to the cluster? So maybe a 5 minute sleep?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The URL could also change. If the service is using NodePort, the original node may have scaled down and replaced with another node. If the service is LoadBalancer, the load balancer may have been updated.

@dnephin dnephin force-pushed the dnephin/connector-goroutines branch 2 times, most recently from a17c3da to 22c1322 Compare October 4, 2022 21:58
This errgroup allows us to shutdown everything if one of the critical
operations fails.
So that we can block on list grants
@dnephin dnephin force-pushed the dnephin/connector-goroutines branch from 22c1322 to 82ee11b Compare October 6, 2022 21:55
@dnephin dnephin merged commit 1bbf434 into main Oct 6, 2022
@dnephin dnephin deleted the dnephin/connector-goroutines branch October 6, 2022 22:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants