forked from wrenn/wrenn
Fix review issues: detached contexts, loop device leak, timer leak, size_bytes
- Use context.Background() with timeout in destroySandbox/failBuild so cleanup and DB writes survive parent context cancellation on shutdown - Fix loop device refcount leak in FlattenRootfs when dmDevice is nil - Replace time.After with time.NewTimer in healthcheck polling to avoid goroutine leak when healthcheck passes early - Capture size_bytes from CreateSnapshot/FlattenRootfs RPC responses instead of hardcoding 0 in the templates table insert - Avoid leaking internal error details to API clients in build handler
This commit is contained in:
@ -839,6 +839,8 @@ func (m *Manager) FlattenRootfs(ctx context.Context, sandboxID, name string) (in
|
||||
|
||||
outputPath := snapshot.RootfsPath(m.cfg.ImagesDir, name)
|
||||
if sb.dmDevice == nil {
|
||||
m.cleanupDM(sb)
|
||||
warnErr("template dir cleanup error", name, snapshot.Remove(m.cfg.ImagesDir, name))
|
||||
return 0, fmt.Errorf("sandbox %s has no dm device", sandboxID)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user