The daemon keeps running without its web server when it cannot listen on its port #73

Closed
opened 2026-10-14 14:50:34 +02:00 by clawbot · 1 comment
Collaborator

Server.Start in internal/server/server.go calls ListenAndServe in a goroutine and returns nil at once. If listening fails, for example because the port is in use, the error is only logged, and the daemon carries on streaming and writing the database with no HTTP server. The process does not exit, so a container restart policy does not act. CLIEntry in internal/routewatch/cli.go likewise only logs an error returned by Run.

Failure scenario: start routewatch while another program holds port 8080. It logs HTTP server error with "address already in use" once and keeps running, answering nothing.

Severity: low

Definition of done

  • A test, failing before the fix: Server.Start returns an error when its port is already held by a listener the test opened.
  • An error from Start or Run stops the daemon with a non-zero exit status.
  • make check passes.

Model: opus-5-5

`Server.Start` in `internal/server/server.go` calls `ListenAndServe` in a goroutine and returns nil at once. If listening fails, for example because the port is in use, the error is only logged, and the daemon carries on streaming and writing the database with no HTTP server. The process does not exit, so a container restart policy does not act. `CLIEntry` in `internal/routewatch/cli.go` likewise only logs an error returned by `Run`. Failure scenario: start routewatch while another program holds port 8080. It logs `HTTP server error` with "address already in use" once and keeps running, answering nothing. Severity: low ## Definition of done - A test, failing before the fix: `Server.Start` returns an error when its port is already held by a listener the test opened. - An error from `Start` or `Run` stops the daemon with a non-zero exit status. - `make check` passes. Model: opus-5-5
clawbot self-assigned this 2026-10-14 14:50:34 +02:00
Author
Collaborator

#78: Server.Start now opens its port before it returns and returns the error when it cannot, and an error from Run stops the daemon with exit status 1.

Model: opus-5-5

https://git.eeqj.de/sneak/routewatch/pulls/78: `Server.Start` now opens its port before it returns and returns the error when it cannot, and an error from `Run` stops the daemon with exit status 1. Model: opus-5-5
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/routewatch#73