Skip to content

Commit 90062f9

Browse files
committed
Don't use DeadlineExceeded
Returning DeadlineExceeded is confusing. While it was not graceful, the requested action itself was completed. Signed-off-by: Kazuyoshi Kato <[email protected]>
1 parent 7a4b897 commit 90062f9

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

runtime/service.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1187,7 +1187,7 @@ func (s *service) shutdown(
11871187
if err == nil {
11881188
return nil
11891189
}
1190-
return status.Error(codes.DeadlineExceeded, fmt.Sprintf("the VMM was killed forcibly: %v", err))
1190+
return status.Error(codes.Internal, fmt.Sprintf("the VMM was killed forcibly: %v", err))
11911191
}
11921192

11931193
// shutdownLoop sends multiple different shutdown requests to stop the VMM.

runtime/service_integ_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1392,7 +1392,7 @@ func TestStopVM_Isolated(t *testing.T) {
13921392
stopFunc: func(ctx context.Context, fcClient fccontrol.FirecrackerService, req proto.CreateVMRequest) {
13931393
_, err = fcClient.StopVM(ctx, &proto.StopVMRequest{VMID: req.VMID})
13941394
errCode := status.Code(err)
1395-
assert.Equal(codes.DeadlineExceeded, errCode, "the error code must be DeadlineExceeded")
1395+
assert.Equal(codes.Internal, errCode, "the error code must be Internal")
13961396

13971397
if req.JailerConfig != nil {
13981398
// No "signal: ..." error with runc since it traps the signal

0 commit comments

Comments
 (0)