Skip to content

Commit

Permalink
Merge pull request #75 from mittwald/fix/listenerdeadlock
Browse files Browse the repository at this point in the history
Fix deadlock on listener job + fix race
  • Loading branch information
elenz97 authored Mar 13, 2024
2 parents de8c9fc + 1cf3391 commit db0cf9a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/proc/basejob.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ func (job *baseJob) startOnce(ctx context.Context, process chan<- *os.Process) e
defer job.closeStdFiles()

if err := job.CreateAndOpenStdFile(job.Config); err != nil {
return nil
return err
}

cmd := exec.Command(job.Config.Command, job.Config.Args...)
Expand Down
2 changes: 2 additions & 0 deletions pkg/proc/job_lazy.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ func (job *LazyJob) AssertStarted(ctx context.Context) error {

l.Info("process terminated")

job.lazyStartLock.Lock()
defer job.lazyStartLock.Unlock()
job.process = nil
}()

Expand Down

0 comments on commit db0cf9a

Please sign in to comment.