Commit 6fe7b02e37

6fe7b02e37e2056ab9993e220be601b9a71a09e7

parent: ac22431b2b

Verified · cmc ci/build: success ci/test: failure

cmc <hello@cleberg.net> · 2026-09-09 03:48 UTC

runner: clip sshOpts after prepending the identity

The prepend can leave spare capacity, and the later appends in the log
stream and ssh() run from concurrent workers, so with -jobs > 1 they
would write the same backing array.

Ref #184
cmd/gitbay-runner/main.go +4 −1
@@ -19,6 +19,7 @@ import (
1919 "os/exec"
2020 "os/signal"
2121 "path/filepath"
22 "slices"
2223 "strings"
2324 "sync"
2425 "syscall"
@@ -149,7 +150,9 @@ func main() {
149150 *identity = p
150151 }
151152 }
152 r.sshOpts = append(identityOpts(*identity), r.sshOpts...)
153 // Clipped: the later appends run from concurrent workers, and spare
154 // capacity here would have them writing the same backing array.
155 r.sshOpts = slices.Clip(append(identityOpts(*identity), r.sshOpts...))
153156 r.untrusted = *untrusted
154157 for _, name := range strings.Split(*repos, ",") {
155158 if name = strings.TrimSpace(name); name != "" {