Skip to content

Commit cb37c6b

Browse files
authored
call builtinUnused() if internal SSH is disabled (#20877)
The graceful manager waits for 4 listeners to be created or to be told that they are not needed. If it is not told about them it will indefinitely and timeout. This leads to SVC hosts not being told of being in the readyState but on Unix would lead to the termination of the process. There was an unfortunate regression in #20299 which missed this subtly and in the case whereby SSH is disabled the `builtinUnused()` is not called. This PR adds a call to `builtinUnused()` when not using the builtin ssh to allow `createServerWaitGroup.Done()` to be called. In addition it was noted that the if/else clauses for timeout informing of the SVC host were in the wrong order. These have been swapped. Fix #20609
1 parent 3d52edc commit cb37c6b

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

modules/graceful/manager_windows.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,9 @@ func (g *Manager) start() {
114114
// Execute makes Manager implement svc.Handler
115115
func (g *Manager) Execute(args []string, changes <-chan svc.ChangeRequest, status chan<- svc.Status) (svcSpecificEC bool, exitCode uint32) {
116116
if setting.StartupTimeout > 0 {
117-
status <- svc.Status{State: svc.StartPending}
118-
} else {
119117
status <- svc.Status{State: svc.StartPending, WaitHint: uint32(setting.StartupTimeout / time.Millisecond)}
118+
} else {
119+
status <- svc.Status{State: svc.StartPending}
120120
}
121121

122122
log.Trace("Awaiting server start-up")

modules/ssh/init.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import (
1818

1919
func Init() error {
2020
if setting.SSH.Disabled {
21+
builtinUnused()
2122
return nil
2223
}
2324

0 commit comments

Comments
 (0)