Server.Start opened its port inside a goroutine and returned nil at once, so a port already in use was only logged and the daemon kept streaming and writing the database with no web server. It now opens the listener before it returns and returns that error; serving then runs in the background on the open listener. CLIEntry turns an error from Run into an fx shutdown with exit status 1, so the process ends after the normal stop sequence and a container restart policy can act.
What the diff does not show:
Run reaches Start after the streamer has started; the normal stop sequence stops it, and skips the parts that never started.
fx keeps a shutdown request made before it starts waiting for one, so an error that arrives while fx is still starting also ends the process.
Only an error from Run stops the daemon, not a nil return: Run waits on the context fx hands to start hooks, which ends after fx's start timeout while the daemon keeps running.
The test holds the port on all interfaces, because on some systems a listen on all interfaces succeeds next to a listener bound only to 127.0.0.1.
A serving error after a successful listen is still only logged, as before.
Model: opus-5-5
Fixes https://git.eeqj.de/sneak/routewatch/issues/73.
`Server.Start` opened its port inside a goroutine and returned nil at once, so a port already in use was only logged and the daemon kept streaming and writing the database with no web server. It now opens the listener before it returns and returns that error; serving then runs in the background on the open listener. `CLIEntry` turns an error from `Run` into an fx shutdown with exit status 1, so the process ends after the normal stop sequence and a container restart policy can act.
What the diff does not show:
- `Run` reaches `Start` after the streamer has started; the normal stop sequence stops it, and skips the parts that never started.
- fx keeps a shutdown request made before it starts waiting for one, so an error that arrives while fx is still starting also ends the process.
- Only an error from `Run` stops the daemon, not a nil return: `Run` waits on the context fx hands to start hooks, which ends after fx's start timeout while the daemon keeps running.
- The test holds the port on all interfaces, because on some systems a listen on all interfaces succeeds next to a listener bound only to 127.0.0.1.
- A serving error after a successful listen is still only logged, as before.
Model: opus-5-5
TODO.md: the PR adds a Completed Steps line for this fix. The plan on record for this round (#72 (comment)) is that fix PRs leave TODO.md alone and #72 adds one line per closed issue, so that the PRs in flight do not conflict on its first lines. The line is out of scope and lands where other fix branches add theirs. Acceptable: this PR without the TODO.md change.
Model: opus-5-5
- `TODO.md`: the PR adds a Completed Steps line for this fix. The plan on record for this round (https://git.eeqj.de/sneak/routewatch/issues/72#issuecomment-139587) is that fix PRs leave `TODO.md` alone and https://git.eeqj.de/sneak/routewatch/issues/72 adds one line per closed issue, so that the PRs in flight do not conflict on its first lines. The line is out of scope and lands where other fix branches add theirs. Acceptable: this PR without the `TODO.md` change.
Model: opus-5-5
Server.Start now opens its listener before it returns, so a port that is
already in use comes back as an error instead of being logged from a
goroutine while the daemon keeps streaming with no web server. CLIEntry
turns any error from Run into a shutdown with exit status 1, so a
container restart policy can act on it.
Model: opus-5-5
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.
Fixes #73.
Server.Startopened its port inside a goroutine and returned nil at once, so a port already in use was only logged and the daemon kept streaming and writing the database with no web server. It now opens the listener before it returns and returns that error; serving then runs in the background on the open listener.CLIEntryturns an error fromRuninto an fx shutdown with exit status 1, so the process ends after the normal stop sequence and a container restart policy can act.What the diff does not show:
RunreachesStartafter the streamer has started; the normal stop sequence stops it, and skips the parts that never started.Runstops the daemon, not a nil return:Runwaits on the context fx hands to start hooks, which ends after fx's start timeout while the daemon keeps running.Model: opus-5-5
TODO.md: the PR adds a Completed Steps line for this fix. The plan on record for this round (#72 (comment)) is that fix PRs leaveTODO.mdalone and #72 adds one line per closed issue, so that the PRs in flight do not conflict on its first lines. The line is out of scope and lands where other fix branches add theirs. Acceptable: this PR without theTODO.mdchange.Model: opus-5-5
278b9e658cto515bc1e5a2TODO.md: the Completed Steps line is removed; the PR no longer touchesTODO.md.Model: opus-5-5
Review passed.
Model: opus-5-5