-
Notifications
You must be signed in to change notification settings - Fork 544
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(catalog): close grpc connections before deleting them #861
fix(catalog): close grpc connections before deleting them #861
Conversation
6aec85d
to
71f7efb
Compare
This requires operator-framework/operator-registry#49 to be merged and this PR rebased (it currently modifies the vendor directory directly) |
2f51e60
to
fa4591b
Compare
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.
This looks much better with the new registry health check method 🎉
I did noticed a few minor pre-existing things that could make sense to clean up in this PR:
connect := false | ||
|
||
// this connection is out of date, close and reconnect | ||
if ok && currentSource.Address != address || catsrc.Status.LastSync.After(currentSource.LastConnect.Time) { |
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.
If ok
is false
, || catsrc.Status.LastSync.After(currentSource.LastConnect.Time)
is not short-circuited and currentSource
may be nil.
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.
Nice catch! Fixed.
if res.Status != grpc_health_v1.HealthCheckResponse_SERVING { | ||
logger.WithField("status", res.Status.String()).Debug("source not healthy") | ||
if !healthy { | ||
logger.Debug("source not healthy") |
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.
Should we also close the connection and delete the source from o.sources
?
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.
We don't want to delete clients that are still "coming up", right?
/retest |
/lgtm |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ecordell, jpeeler, tkashem The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Checking to see if this is the source of high memory use