Compare commits
No commits in common. "d4405a0cde1e829c701fa211272d11518730b536" and "fd6959fff82a87e92d9e73cb07e210cebb675050" have entirely different histories.
d4405a0cde
...
fd6959fff8
24
acid.go
24
acid.go
@ -183,7 +183,7 @@ var templateTask = template.Must(template.New("tasks").Parse(`
|
||||
{{end}}
|
||||
</head>
|
||||
<body>
|
||||
<h1><a href="..">Tasks</a> » {{.ID}}</h1>
|
||||
<h1><a href="/">Tasks</a> » {{.ID}}</h1>
|
||||
<dl>
|
||||
<dt>Project</dt>
|
||||
<dd><a href="{{.RepoURL}}">{{.FullName}}</a></dd>
|
||||
@ -374,8 +374,7 @@ func rpcRestart(w io.Writer, ids []int64) {
|
||||
// The executor bumps to "running" after inserting into gRunning,
|
||||
// so we should not need to exclude that state here.
|
||||
result, err := gDB.ExecContext(context.Background(),
|
||||
`UPDATE task SET state = ?, detail = '' WHERE id = ?`,
|
||||
taskStateNew, id)
|
||||
`UPDATE task SET state = ? WHERE id = ?`, taskStateNew, id)
|
||||
if err != nil {
|
||||
fmt.Fprintf(w, "%d: %s\n", id, err)
|
||||
} else if n, _ := result.RowsAffected(); n != 1 {
|
||||
@ -788,22 +787,6 @@ func executorRunTask(ctx context.Context, task Task) error {
|
||||
"ACID_RUNNER="+rt.DB.Runner,
|
||||
)
|
||||
|
||||
// Pushing the runner into a new process group that can be killed at once
|
||||
// with all its children isn't bullet-proof, it messes with job control
|
||||
// when acid is run from an interactive shell, and it also seems avoidable
|
||||
// (use "exec" in runner scripts, so that VMs take over the process).
|
||||
// Maybe this is something that could be opt-in.
|
||||
/*
|
||||
cmd.SysProcAttr = &syscall.SysProcAttr{Setpgid: true}
|
||||
cmd.Cancel = func() error {
|
||||
err := syscall.Kill(-cmd.Process.Pid, syscall.SIGKILL)
|
||||
if err == syscall.ESRCH {
|
||||
return os.ErrProcessDone
|
||||
}
|
||||
return err
|
||||
}
|
||||
*/
|
||||
|
||||
log.Printf("task %d for %s: starting %s\n",
|
||||
rt.DB.ID, rt.DB.FullName(), rt.Runner.Name)
|
||||
|
||||
@ -829,9 +812,10 @@ func executorRunTask(ctx context.Context, task Task) error {
|
||||
case <-ctxRunner.Done():
|
||||
// This doesn't leave the runner almost any time on our shutdown,
|
||||
// but whatever--they're supposed to be ephemeral.
|
||||
// Moreover, we don't even override cmd.CancelFunc.
|
||||
case <-time.After(5 * time.Second):
|
||||
}
|
||||
_ = cmd.Cancel()
|
||||
_ = cmd.Process.Kill()
|
||||
}()
|
||||
|
||||
client, err := executorConnect(ctxRunner, &ssh.ClientConfig{
|
||||
|
Loading…
x
Reference in New Issue
Block a user