mirror of
https://github.com/containerd/containerd.git
synced 2026-06-30 19:58:29 +00:00
Merge pull request #13483 from AkihiroSuda/fix-lima-5030
runc-shim: don't hold the service lock across runc create
This commit is contained in:
@@ -221,9 +221,6 @@ func (s *service) preStart(c *runc.Container) (handleStarted func(*runc.Containe
|
||||
|
||||
// Create a new initial process and container with the underlying OCI runtime
|
||||
func (s *service) Create(ctx context.Context, r *taskAPI.CreateTaskRequest) (_ *taskAPI.CreateTaskResponse, err error) {
|
||||
s.mu.Lock()
|
||||
defer s.mu.Unlock()
|
||||
|
||||
s.lifecycleMu.Lock()
|
||||
handleStarted, cleanup := s.preStart(nil)
|
||||
s.lifecycleMu.Unlock()
|
||||
@@ -234,7 +231,9 @@ func (s *service) Create(ctx context.Context, r *taskAPI.CreateTaskRequest) (_ *
|
||||
return nil, err
|
||||
}
|
||||
|
||||
s.mu.Lock()
|
||||
s.containers[r.ID] = container
|
||||
s.mu.Unlock()
|
||||
|
||||
s.send(&eventstypes.TaskCreate{
|
||||
ContainerID: r.ID,
|
||||
|
||||
Reference in New Issue
Block a user