Merge pull request #2624 from Ace-Tang/fix_delete_lock

fix: modify lock location of exec delete avoid exec hang
This commit is contained in:
Phil Estes
2018-09-11 10:26:32 -04:00
committed by GitHub
2 changed files with 8 additions and 6 deletions

View File

@@ -60,11 +60,11 @@ func (s *execCreatedState) Start(ctx context.Context) error {
}
func (s *execCreatedState) Delete(ctx context.Context) error {
s.p.mu.Lock()
defer s.p.mu.Unlock()
if err := s.p.delete(ctx); err != nil {
return err
}
s.p.mu.Lock()
defer s.p.mu.Unlock()
return s.transition("deleted")
}
@@ -168,11 +168,11 @@ func (s *execStoppedState) Start(ctx context.Context) error {
}
func (s *execStoppedState) Delete(ctx context.Context) error {
s.p.mu.Lock()
defer s.p.mu.Unlock()
if err := s.p.delete(ctx); err != nil {
return err
}
s.p.mu.Lock()
defer s.p.mu.Unlock()
return s.transition("deleted")
}