Summary
In pkg/backend/push.go, blob content is opened with src.PullBlob(...) and then passed to dst.Blobs().Push(...) as io.NopCloser(reader).
This prevents the original io.ReadCloser from being closed. After the upload starts reading, the underlying distribution file reader may keep its file descriptor open until process exit.
Impact
Pushing many blobs can accumulate open file descriptors and may eventually hit the OS limit.
Why this happens
PullBlob() returns an io.ReadCloser
pb.Add(...) wraps it for progress reporting
io.NopCloser(...) replaces the real Close() with a no-op
- the original blob reader is never explicitly closed
Suggested fix
Close the original content returned by PullBlob() in pushIfNotExist(), for example with:
defer func() { _ = content.Close() }()
Summary
In
pkg/backend/push.go, blob content is opened withsrc.PullBlob(...)and then passed todst.Blobs().Push(...)asio.NopCloser(reader).This prevents the original
io.ReadCloserfrom being closed. After the upload starts reading, the underlyingdistributionfile reader may keep its file descriptor open until process exit.Impact
Pushing many blobs can accumulate open file descriptors and may eventually hit the OS limit.
Why this happens
PullBlob()returns anio.ReadCloserpb.Add(...)wraps it for progress reportingio.NopCloser(...)replaces the realClose()with a no-opSuggested fix
Close the original
contentreturned byPullBlob()inpushIfNotExist(), for example with: