Skip to content

Commit

Permalink
Use SIGKILL, remove patchDrive artifacts
Browse files Browse the repository at this point in the history
Signed-off-by: Plamen Petrov <[email protected]>
  • Loading branch information
plamenmpetrov authored and ustiugov committed Sep 22, 2020
1 parent 8fba681 commit 7a8cf27
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions runtime/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,8 @@ type service struct {
vsockPortMu sync.Mutex

// httpControlClient is to send pause/resume/snapshot commands to the microVM
httpControlClient *http.Client
firecrackerPid int
taskDrivePathOnHost string
httpControlClient *http.Client
firecrackerPid int
}

func shimOpts(shimCtx context.Context) (*shim.Opts, error) {
Expand Down Expand Up @@ -838,7 +837,7 @@ func (s *service) CreateSnapshot(ctx context.Context, req *proto.CreateSnapshotR
// Offload Shuts down a VM and deletes the corresponding firecracker socket
// and vsock. All of the other resources will persist
func (s *service) Offload(ctx context.Context, req *proto.OffloadRequest) (*empty.Empty, error) {
if err := syscall.Kill(s.firecrackerPid, 9); err != nil {
if err := syscall.Kill(s.firecrackerPid, syscall.SIGKILL); err != nil {
s.logger.WithError(err).Error("Failed to kill firecracker process")
return nil, err
}
Expand Down Expand Up @@ -1061,8 +1060,6 @@ func (s *service) Create(requestCtx context.Context, request *taskAPI.CreateTask
}
rootfsMnt := request.Rootfs[0]

s.taskDrivePathOnHost = rootfsMnt.Source

err = s.containerStubHandler.Reserve(requestCtx, request.ID,
rootfsMnt.Source, vmBundleDir.RootfsPath(), "ext4", nil, s.driveMountClient, s.machine)
if err != nil {
Expand Down

0 comments on commit 7a8cf27

Please sign in to comment.