You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A goroutine leak is occurred when imports an invalid image tarball. The invalid image tarball can be made as flows:
touch test.tar
echo'aaa'>> test.tar
Then use the invalid image tarball as an base image import to the storage and it will return error with 'error adding layer with blob'. But a goroutine is leak at this time.
With go pprof tool(net/http/pprof), we trace the goroutine was blok in github.com/vbatts/tar-split/archive/tar.(*Reader).readHeader .
func (tr*Reader) readHeader() (*Header, *block, error) {
n, err:=io.ReadFull(tr.r, tr.blk[:]) // This is the block point...
}
Because the io.ReadFull will call tr.r.Read() and the tr.r is the read endpoint of a pip which create in NewLogger.
So, if the write endpoint of the pip never close, the readHeader will block and lead a goroutine leak. Since io.Pipe is in-memory, close with an defer clause is safety after it created.
The text was updated successfully, but these errors were encountered:
A goroutine leak is occurred when imports an invalid image tarball. The invalid image tarball can be made as flows:
Then use the invalid image tarball as an base image import to the storage and it will return error with 'error adding layer with blob'. But a goroutine is leak at this time.
With go pprof tool(
net/http/pprof
), we trace the goroutine was blok ingithub.aaakk.us.kg/vbatts/tar-split/archive/tar.(*Reader).readHeader
.Because the io.ReadFull will call tr.r.Read() and the tr.r is the read endpoint of a pip which create in NewLogger.
So, if the write endpoint of the pip never close, the readHeader will block and lead a goroutine leak. Since io.Pipe is in-memory, close with an defer clause is safety after it created.
The text was updated successfully, but these errors were encountered: