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

fix(catalog): close grpc connections before deleting them #861

Merged

Conversation

ecordell
Copy link
Member

Checking to see if this is the source of high memory use

@openshift-ci-robot openshift-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 16, 2019
@openshift-ci-robot openshift-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels May 16, 2019
@ecordell ecordell force-pushed the grpc-close branch 4 times, most recently from 6aec85d to 71f7efb Compare May 20, 2019 17:45
@ecordell
Copy link
Member Author

This requires operator-framework/operator-registry#49 to be merged and this PR rebased (it currently modifies the vendor directory directly)

@ecordell ecordell force-pushed the grpc-close branch 2 times, most recently from 2f51e60 to fa4591b Compare May 21, 2019 12:19
@ecordell ecordell changed the title WIP: fix(catalog): close grpc connections before deleting them fix(catalog): close grpc connections before deleting them May 21, 2019
@openshift-ci-robot openshift-ci-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels May 21, 2019
Copy link
Member

@njhale njhale left a 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) {
Copy link
Member

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.

Copy link
Member Author

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")
Copy link
Member

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?

Copy link
Member Author

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?

@openshift-ci-robot openshift-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels May 21, 2019
@ecordell
Copy link
Member Author

/retest

@jpeeler
Copy link

jpeeler commented May 22, 2019

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label May 22, 2019
@tkashem
Copy link
Collaborator

tkashem commented May 22, 2019

/lgtm

@openshift-ci-robot
Copy link
Collaborator

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-robot openshift-merge-robot merged commit ea72079 into operator-framework:master May 23, 2019
@ecordell ecordell deleted the grpc-close branch May 23, 2019 12:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants