File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -175,14 +175,23 @@ func (s *service) shutdown(ctx context.Context) error {
175175}
176176
177177// unmountAllWithRetry asks the guest to unmount all tracked mounts, retrying
178- // briefly on transient failures. Returns the last UnmountAll error if ctx is
179- // cancelled before a successful call.
178+ // briefly on transient failures (e.g. EBUSY). Permanent errors — including
179+ // Unimplemented, connection errors, and context cancellation — stop the
180+ // retry immediately.
180181func unmountAllWithRetry (ctx context.Context , mc mountAPI.TTRPCMountService ) error {
181182 for {
182183 _ , err := mc .UnmountAll (ctx , & mountAPI.UnmountAllRequest {})
183184 if err == nil {
184185 return nil
185186 }
187+ // Convert gRPC/TTRPC status errors to errdefs so IsNotImplemented works.
188+ native := errgrpc .ToNative (err )
189+ // Stop immediately on permanent errors: connection gone or method not
190+ // implemented. Only retry transient errors (e.g. EBUSY from the guest).
191+ if errors .Is (err , ttrpc .ErrClosed ) || errors .Is (err , io .EOF ) ||
192+ errdefs .IsNotImplemented (native ) {
193+ return err
194+ }
186195 select {
187196 case <- ctx .Done ():
188197 return err
You can’t perform that action at this time.
0 commit comments