detached b60a661

fix: lowercase the host name in the loopback check; point the orphan cleanup comments to JobExtension.cs:891-939; drop a stale comment in proc.go

commit
b60a661f688b0f4d81937e9452175ff8305e3da8
author
brice · · 2026-10-12 20:14 UTC
parent
799f55c
signature
GPG VerifiedCD88F9E564E0102646FB6077A1A07C7C7C3E349D · arch-gpg Verified for the committer email
3 files · +6 -4
M internal/executor/proc.go +3 -3
@@ -237,7 +237,7 @@ func runProcess(spec procSpec) (procResult, error) {
237237 // is named "KillProcessTree" but does not kill the tree). What the shell
238238 // started is left to the shell: bash forwards nothing to a foreground
239239 // child it waits for, and the children that outlive the step are
240- // killed by "Complete job" (the orphan cleanup, JobExtension.cs:132).
240+ // killed by "Complete job" (the orphan cleanup, JobExtension.cs:891-939).
241241 // The step is still started in its own process group, so that a signal
242242 // sent to the executor's group (init forwarding a SIGTERM) does not reach
243243 // it before the executor decides.
@@ -280,7 +280,7 @@ func runProcess(spec procSpec) (procResult, error) {
280280 return func() {
281281 mu.Lock()
282282 defer mu.Unlock()
283- if !done { // the group id could be reused once the shell is reaped
283+ if !done {
284284 spec.Signal(pid, sig)
285285 }
286286 }
@@ -394,7 +394,7 @@ func processTrackingValue(pid int) string {
394394 }
395395
396396 // killOrphans kills the processes that carry the tracking id and were not
397-// there before the job (JobExtension.FinalizeJob, JobExtension.cs:132-180).
397+// there before the job (JobExtension.FinalizeJob, JobExtension.cs:891-939).
398398 // logf receives the "Terminate orphan process" lines.
399399 func killOrphans(id string, before map[string]bool, logf func(string)) {
400400 self := os.Getpid()
@@ -237,7 +237,7 @@ func runProcess(spec procSpec) (procResult, error) {
237 // is named "KillProcessTree" but does not kill the tree). What the shell237 // is named "KillProcessTree" but does not kill the tree). What the shell
238 // started is left to the shell: bash forwards nothing to a foreground238 // started is left to the shell: bash forwards nothing to a foreground
239 // child it waits for, and the children that outlive the step are239 // child it waits for, and the children that outlive the step are
240- // killed by "Complete job" (the orphan cleanup, JobExtension.cs:132).240+ // killed by "Complete job" (the orphan cleanup, JobExtension.cs:891-939).
241 // The step is still started in its own process group, so that a signal241 // The step is still started in its own process group, so that a signal
242 // sent to the executor's group (init forwarding a SIGTERM) does not reach242 // sent to the executor's group (init forwarding a SIGTERM) does not reach
243 // it before the executor decides.243 // it before the executor decides.
@@ -280,7 +280,7 @@ func runProcess(spec procSpec) (procResult, error) {
280 return func() {280 return func() {
281 mu.Lock()281 mu.Lock()
282 defer mu.Unlock()282 defer mu.Unlock()
283- if !done { // the group id could be reused once the shell is reaped283+ if !done {
284 spec.Signal(pid, sig)284 spec.Signal(pid, sig)
285 }285 }
286 }286 }
@@ -394,7 +394,7 @@ func processTrackingValue(pid int) string {
394 }394 }
395 395
396 // killOrphans kills the processes that carry the tracking id and were not396 // killOrphans kills the processes that carry the tracking id and were not
397-// there before the job (JobExtension.FinalizeJob, JobExtension.cs:132-180).397+// there before the job (JobExtension.FinalizeJob, JobExtension.cs:891-939).
398 // logf receives the "Terminate orphan process" lines.398 // logf receives the "Terminate orphan process" lines.
399 func killOrphans(id string, before map[string]bool, logf func(string)) {399 func killOrphans(id string, before map[string]bool, logf func(string)) {
400 self := os.Getpid()400 self := os.Getpid()
M internal/host/rpc.go +2 -1
@@ -58,7 +58,8 @@ func CheckURL(raw string, allowInsecure bool) error {
5858 }
5959
6060 func isLoopback(host string) bool {
61- if host == "localhost" {
61+ // Host names are not case sensitive (LOCALHOST, Localhost).
62+ if strings.EqualFold(host, "localhost") {
6263 return true
6364 }
6465 ip, err := netip.ParseAddr(host)
@@ -58,7 +58,8 @@ func CheckURL(raw string, allowInsecure bool) error {
58 }58 }
59 59
60 func isLoopback(host string) bool {60 func isLoopback(host string) bool {
61- if host == "localhost" {61+ // Host names are not case sensitive (LOCALHOST, Localhost).
62+ if strings.EqualFold(host, "localhost") {
62 return true63 return true
63 }64 }
64 ip, err := netip.ParseAddr(host)65 ip, err := netip.ParseAddr(host)
M internal/host/rpc_test.go +1 -0
@@ -24,6 +24,7 @@ func TestCheckURL(t *testing.T) {
2424 {"https://ermite.example.org", false, ""},
2525 {"https://ermite.example.org:8443/base", false, ""},
2626 {"http://localhost:8080", false, ""},
27+ {"http://LOCALHOST:8080", false, ""},
2728 {"http://127.0.0.1:8080", false, ""},
2829 {"http://[::1]:8080", false, ""},
2930 {"http://ermite.example.org", false, "must be https"},
@@ -24,6 +24,7 @@ func TestCheckURL(t *testing.T) {
24 {"https://ermite.example.org", false, ""},24 {"https://ermite.example.org", false, ""},
25 {"https://ermite.example.org:8443/base", false, ""},25 {"https://ermite.example.org:8443/base", false, ""},
26 {"http://localhost:8080", false, ""},26 {"http://localhost:8080", false, ""},
27+ {"http://LOCALHOST:8080", false, ""},
27 {"http://127.0.0.1:8080", false, ""},28 {"http://127.0.0.1:8080", false, ""},
28 {"http://[::1]:8080", false, ""},29 {"http://[::1]:8080", false, ""},
29 {"http://ermite.example.org", false, "must be https"},30 {"http://ermite.example.org", false, "must be https"},

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 4

Tags 11

↑↓ moveenter openesc close