internal/server/server.go starts the HTTP server from its start hook with go srv.serve(). serveUntilShutdown calls ListenAndServe; when that fails (the port is taken, or the address cannot be bound) it logs listen error and cancels the server's own context, and serve returns. Nothing tells fx, so the process keeps running: the IRC listener and every other component stay up, the exit status is never set, and the HTTP API and web client are simply missing. A supervisor or container sees a healthy process. Found by the worker on #166, read from the code on 292f1eb.
Fix: bind the listener in the start hook (net.Listen with the configured address), so a failed bind returns an error from OnStart and fx stops startup and exits non-zero; then serve that listener in a goroutine. An error from serving after a successful bind (not http.ErrServerClosed) shuts the app down through fx.Shutdowner with a non-zero exit code.
Definition of done
With the HTTP port already taken, neoircd exits non-zero at startup with an error naming the address.
A test in internal/server that starting the server on a taken port returns an error from the start hook.
One reviewed PR against next.
Model: opus-5-5
`internal/server/server.go` starts the HTTP server from its start hook with `go srv.serve()`. `serveUntilShutdown` calls `ListenAndServe`; when that fails (the port is taken, or the address cannot be bound) it logs `listen error` and cancels the server's own context, and `serve` returns. Nothing tells fx, so the process keeps running: the IRC listener and every other component stay up, the exit status is never set, and the HTTP API and web client are simply missing. A supervisor or container sees a healthy process. Found by the worker on https://git.eeqj.de/sneak/neoirc/pulls/166, read from the code on `292f1eb`.
Fix: bind the listener in the start hook (`net.Listen` with the configured address), so a failed bind returns an error from `OnStart` and fx stops startup and exits non-zero; then serve that listener in a goroutine. An error from serving after a successful bind (not `http.ErrServerClosed`) shuts the app down through `fx.Shutdowner` with a non-zero exit code.
## Definition of done
1. With the HTTP port already taken, `neoircd` exits non-zero at startup with an error naming the address.
2. A test in `internal/server` that starting the server on a taken port returns an error from the start hook.
3. One reviewed PR against `next`.
Model: opus-5-5
clawbot
self-assigned this 2026-10-20 21:49:15 +02:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
internal/server/server.gostarts the HTTP server from its start hook withgo srv.serve().serveUntilShutdowncallsListenAndServe; when that fails (the port is taken, or the address cannot be bound) it logslisten errorand cancels the server's own context, andservereturns. Nothing tells fx, so the process keeps running: the IRC listener and every other component stay up, the exit status is never set, and the HTTP API and web client are simply missing. A supervisor or container sees a healthy process. Found by the worker on #166, read from the code on292f1eb.Fix: bind the listener in the start hook (
net.Listenwith the configured address), so a failed bind returns an error fromOnStartand fx stops startup and exits non-zero; then serve that listener in a goroutine. An error from serving after a successful bind (nothttp.ErrServerClosed) shuts the app down throughfx.Shutdownerwith a non-zero exit code.Definition of done
neoircdexits non-zero at startup with an error naming the address.internal/serverthat starting the server on a taken port returns an error from the start hook.next.Model: opus-5-5