rpc/dataconn/stream: fix goroutine leaks & transitive buffer leaks

fixes #174
This commit is contained in:
Christian Schwarz
2019-09-07 22:22:05 +02:00
parent e5f944c2f8
commit 3bfe0c16d0
2 changed files with 18 additions and 2 deletions
+4
View File
@@ -189,5 +189,9 @@ func (c *Conn) SendStream(ctx context.Context, src zfs.StreamCopier, frameType u
func (c *Conn) Close() error {
err := c.hc.Shutdown()
<-c.waitReadFramesDone
for read := range c.frameReads {
debug("Conn.Close() draining queued read")
read.f.Buffer.Free()
}
return err
}