Files
routewatch/TODO.md
T
clawbot 2c32eaa4de
check / check (push) Successful in 2m40s
Stop the streamer without sending on closed queues (closes #34)
Stop cancels the stream and closes the handler queues under the streamer's write lock, but the read loop only checked for a stop before parsing each line. A stop landing after that check made the loop send the message to a closed queue and panic. The loop now checks again under the read lock it already takes before handing the message to the queues, and returns if the stream was stopped.

Stop also clears its cancel function and returns early when there is none, so a second call no longer closes the queues again, as its comment already promised.

The new test calls Stop from the raw handler, which runs in exactly that gap, and then calls Stop a second time.

Model: opus-5-5
2026-09-28 19:13:08 +00:00

66 lines
2.9 KiB
Markdown

# Workflow
* branch (from `main`)
* do the work in Next Step
* move Next Step to the top of Completed Steps
* move the top item of Future Steps into Next Step
* commit (`TODO.md` changes in the same commit as the work)
* merge to `main` if the branch is not protected, otherwise open a PR
* push
# Status
pre-1.0. No git tags. Runs in production-style Docker deployment, but
the policy compliance branch (repo-policies-compliance, make check
passing, clean tree) is unmerged to main and the CI workflow is missing.
# Next Step
Merge repo-policies-compliance into main (3 commits: policy files and
.gitignore, Makefile targets fmt-check/check/docker/hooks, gofmt pass),
then add .gitea/workflows/check.yml as a small follow-up commit so CI
runs make check on main.
# Completed Steps
- 2026-09-28: stopping the daemon while the feed is flowing no longer
panics with "send on closed channel": the read loop checks for a stop
just before handing a message to the handler queues, and a second
`Stop` no longer closes the queues again (closes #34)
- 2026-09-28: `docker stop` no longer kills the daemon 2 seconds after the
stop signal: the entrypoint switches to the `routewatch` user with
`setpriv` instead of `runuser`, so the daemon receives the signal itself
and gets the whole wait `docker stop` allows, up to its own 60-second
limit (closes #33)
- 2026-09-28: ready to run under upaas: a set but invalid `PORT`,
`XDG_DATA_HOME` or `MALLOC_ARENA_MAX` stops the start, the health
check follows `PORT`, README "Running under upaas" section (closes
#31)
- 2026-09-22: realtime in-memory database statistics: counts seeded at
startup and adjusted on every write, oldest/newest route timestamps via
index-end lookups; `/api/v1/stats` no longer scans the tables (closes
#27)
- 2026-07-07 Adopted scripts-to-rule-them-all: `script/` entrypoints,
Makefile shims, README Entrypoints section
- 2026-02-22: repo policy compliance: required policy files, .gitignore
update, Makefile fmt-check/check/docker/hooks targets, gofmt pass
(repo-policies-compliance, unmerged)
- 2026-01-01: WAL checkpointing: periodic (5s), on startup with logging,
TRUNCATE mode; fixed slow queries
- 2025-12-31: status page: navbar, home page with search, oldest/newest
route timestamps, NULL handling in WHOIS stats; container runs as
routewatch user with proper state dir
- 2025-12-30: structured HTTP request logging, increased timeouts,
CIDR prefix URL routing fixes, status page metrics and footer
- 2025-12-29: Dockerfile multi-stage build with source archive; SQLite
incremental vacuum for non-blocking space reclamation
- 2025-07-27: initial RouteWatch BGP stream monitor
# Future Steps
- Verify main is green after the merge: make check locally and the new
CI workflow passing
- Review stale remote branches fix-min-time-calculation and
optimize-sqlite-settings: land or delete
- Clean up the tmp/ directory at the repo root: gitignore or remove