automc: drop waker gate on backend-down predefined status
CI / validate (push) Successful in 38s
CI / docker (push) Successful in 16s

Previously, the predefined "asleep" MOTD response on backend-dial-failure
was only served when the route had a waker registered. For static fleets
(no auto-scale) the gate left clients with a silently-closed TCP socket on
status-pings whenever the backend was down — they couldn't tell whether
the route was wrong, the host was offline, or the proxy was down.

Drop the `waker != nil` gate so any known route's dial-failure on
NextState=Status falls back to the configured asleep/loading MOTD. The
existing per-route override + global AUTO_SCALE_ASLEEP_MOTD chain handles
the actual text. Login attempts still close silently as before — only
status pings get the fallback.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-06-08 18:24:32 +02:00
parent 7884fb1c5f
commit 004ee6dbfd
+8 -2
View File
@@ -659,12 +659,18 @@ func (c *Connector) findAndConnectBackend(frontendConn net.Conn,
} }
} }
if waker != nil && nextState == mcproto.StateStatus { if nextState == mcproto.StateStatus {
// Previously gated on `waker != nil` so only auto-scale routes
// got a predefined response. For static fleets (no waker) clients
// just saw a closed connection on backend-down. Now any known
// route whose backend dial fails returns the configured asleep/
// loading MOTD — falls back to the global AUTO_SCALE_ASLEEP_MOTD
// when no per-route override is set.
logrus.WithFields(logrus.Fields{ logrus.WithFields(logrus.Fields{
"client": clientAddr, "client": clientAddr,
"server": serverAddress, "server": serverAddress,
"isLegacy": isLegacy, "isLegacy": isLegacy,
}).Debug("Scalable backend unreachable: serving predefined status response") }).Debug("Backend unreachable: serving predefined status response")
br := bufio.NewReader(frontendConn) br := bufio.NewReader(frontendConn)
if isLegacy { if isLegacy {