stuck task issue
This commit is contained in:
@@ -334,6 +334,7 @@ func (s *Session) spawnLocked() error {
|
||||
"GIT_COMMITTER_EMAIL="+s.opts.GitEmail,
|
||||
)
|
||||
cmd.Env = append(cmd.Env, s.opts.Env...)
|
||||
cmd.SysProcAttr = &syscall.SysProcAttr{Setpgid: true}
|
||||
|
||||
stdin, err := cmd.StdinPipe()
|
||||
if err != nil {
|
||||
@@ -428,7 +429,7 @@ func (s *Session) restartLocked() error {
|
||||
select {
|
||||
case <-p.done:
|
||||
case <-time.After(10 * time.Second):
|
||||
p.cmd.Process.Kill()
|
||||
syscall.Kill(-p.cmd.Process.Pid, syscall.SIGKILL)
|
||||
<-p.done
|
||||
}
|
||||
return s.spawnLocked()
|
||||
@@ -567,7 +568,7 @@ func (s *Session) Kill() {
|
||||
s.mu.Unlock()
|
||||
|
||||
if p != nil {
|
||||
p.cmd.Process.Kill()
|
||||
syscall.Kill(-p.cmd.Process.Pid, syscall.SIGKILL)
|
||||
<-p.done
|
||||
}
|
||||
s.die()
|
||||
|
||||
Reference in New Issue
Block a user