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

terminate plugin clients explicitly instead of using managed ones #797

Merged
merged 2 commits into from
Aug 30, 2018

Conversation

skriss
Copy link
Contributor

@skriss skriss commented Aug 27, 2018

Signed-off-by: Steve Kriss steve@heptio.com

Fixes #780

@skriss skriss requested a review from ncdc August 27, 2018 16:45
@skriss
Copy link
Contributor Author

skriss commented Aug 27, 2018

@ncdc this look right? Gonna see if I can add some units but wanted to ensure approach is right first.

@ncdc
Copy link
Contributor

ncdc commented Aug 27, 2018

@skriss yes, I think so. I can test it locally to confirm no leak. Give me a few mins...

@skriss
Copy link
Contributor Author

skriss commented Aug 27, 2018

awesome, thanks!

Signed-off-by: Steve Kriss <steve@heptio.com>
@ncdc
Copy link
Contributor

ncdc commented Aug 27, 2018

I can confirm this fixes the gzip flate Writer memory leak:

heap profile: 9: 2051776 [265: 28097984] @ heap/1048576
1: 663552 [19: 12607488] @ 0x1269e71 0x1275961 0x1af0185 0x1af058c 0x1de65f8 0x1f69df7 0x1f68c4d 0x1f8707e 0x1f684c1 0x1f683cb 0x1f870da 0x14237e4 0x14230cd 0x1422ffd 0x1f84078 0x105b7e1
#	0x1269e70	compress/flate.NewWriter+0x30												/usr/local/Cellar/go/1.10.3/libexec/src/compress/flate/deflate.go:667
#	0x1275960	compress/gzip.(*Writer).Write+0x3b0											/usr/local/Cellar/go/1.10.3/libexec/src/compress/gzip/gzip.go:191
#	0x1af0184	github.com/heptio/ark/vendor/github.com/sirupsen/logrus.Entry.log+0x354							/Users/andy/go/src/github.com/heptio/ark/vendor/github.com/sirupsen/logrus/entry.go:114
#	0x1af058b	github.com/heptio/ark/vendor/github.com/sirupsen/logrus.(*Entry).Info+0xab						/Users/andy/go/src/github.com/heptio/ark/vendor/github.com/sirupsen/logrus/entry.go:141
#	0x1de65f7	github.com/heptio/ark/pkg/backup.(*kubernetesBackupper).Backup+0x3c7							/Users/andy/go/src/github.com/heptio/ark/pkg/backup/backup.go:230
#	0x1f69df6	github.com/heptio/ark/pkg/controller.(*backupController).runBackup+0x3d6						/Users/andy/go/src/github.com/heptio/ark/pkg/controller/backup_controller.go:365
#	0x1f68c4c	github.com/heptio/ark/pkg/controller.(*backupController).processBackup+0x5fc						/Users/andy/go/src/github.com/heptio/ark/pkg/controller/backup_controller.go:279
#	0x1f8707d	github.com/heptio/ark/pkg/controller.(*backupController).(github.com/heptio/ark/pkg/controller.processBackup)-fm+0x3d	/Users/andy/go/src/github.com/heptio/ark/pkg/controller/backup_controller.go:102
#	0x1f684c0	github.com/heptio/ark/pkg/controller.(*backupController).processNextWorkItem+0xd0					/Users/andy/go/src/github.com/heptio/ark/pkg/controller/backup_controller.go:191
#	0x1f683ca	github.com/heptio/ark/pkg/controller.(*backupController).runWorker+0x2a							/Users/andy/go/src/github.com/heptio/ark/pkg/controller/backup_controller.go:178
#	0x1f870d9	github.com/heptio/ark/pkg/controller.(*backupController).(github.com/heptio/ark/pkg/controller.runWorker)-fm+0x29	/Users/andy/go/src/github.com/heptio/ark/pkg/controller/backup_controller.go:165
#	0x14237e3	github.com/heptio/ark/vendor/k8s.io/apimachinery/pkg/util/wait.JitterUntil.func1+0x53					/Users/andy/go/src/github.com/heptio/ark/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:133
#	0x14230cc	github.com/heptio/ark/vendor/k8s.io/apimachinery/pkg/util/wait.JitterUntil+0xbc						/Users/andy/go/src/github.com/heptio/ark/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:134
#	0x1422ffc	github.com/heptio/ark/vendor/k8s.io/apimachinery/pkg/util/wait.Until+0x4c						/Users/andy/go/src/github.com/heptio/ark/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:88
#	0x1f84077	github.com/heptio/ark/pkg/controller.(*backupController).Run.func2+0x67							/Users/andy/go/src/github.com/heptio/ark/pkg/controller/backup_controller.go:165

Note that there's only 1 in-use flate Writer out of 19 allocated.

I need to finish up something else first before I can review the diff, FYI

@skriss
Copy link
Contributor Author

skriss commented Aug 27, 2018

np - working on a few unit tests rn, though the manual test is the best verification of this.

Signed-off-by: Steve Kriss <steve@heptio.com>
@skriss skriss changed the title [WIP] terminate plugin clients explicitly instead of using managed ones terminate plugin clients explicitly instead of using managed ones Aug 27, 2018
@skriss
Copy link
Contributor Author

skriss commented Aug 27, 2018

OK, added some unit tests (didn't go too crazy since this is all changed in master, plus manual verification is more effective for this issue, but hit the core scenarios for closing clients).

@skriss skriss added this to the v0.9.4 milestone Aug 28, 2018
@ncdc
Copy link
Contributor

ncdc commented Aug 28, 2018

@nrb @carlisia PTAL

@skriss
Copy link
Contributor Author

skriss commented Aug 28, 2018

@ncdc did you get to do a review on this?

@ncdc
Copy link
Contributor

ncdc commented Aug 28, 2018

@skriss minimal, which is why I'd like Nolan & Carlisia to take a look.

Copy link
Contributor

@nrb nrb left a comment

Choose a reason for hiding this comment

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

LGTM; we're closing the item actions in the controllers, and the actual test shows the leak is gone.

I'm fine merging this unless @skriss wants a 2nd pair of in depth eyes.

@skriss
Copy link
Contributor Author

skriss commented Aug 29, 2018

Per slack I'm fine with this merging now given the reviews/validation that have been done.

@nrb nrb merged commit ca428c7 into vmware-tanzu:release-0.9 Aug 30, 2018
@skriss skriss deleted the plugins-fix-0.9 branch September 6, 2018 16:19
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.

3 participants