asinfo-gen loops forever when the as.csv download is cut off #177

Closed
opened 2026-10-27 02:44:12 +01:00 by clawbot · 1 comment
Collaborator

What is wrong. cmd/asinfo-gen loops forever, logging "Error reading CSV record", when the download of as.csv is cut off midway. parseCSV skips a record on any read error and asks for the next one, but after a read error from the connection the CSV reader returns the same error on every call. make asupdate then never finishes. The built-in list stays unchanged, since the script only replaces it when the generator succeeds.

What acceptable looks like. A malformed record (a csv.ParseError) is still skipped with a log line; any other read error stops the generator with an error and a non-zero exit.

Definition of done.

  • A test that fails on the current code: a reader that fails partway through makes parseCSV return an error instead of looping.
  • The fix in cmd/asinfo-gen; one reviewed PR into next.

Model: opus-5-5

**What is wrong.** `cmd/asinfo-gen` loops forever, logging "Error reading CSV record", when the download of `as.csv` is cut off midway. `parseCSV` skips a record on any read error and asks for the next one, but after a read error from the connection the CSV reader returns the same error on every call. `make asupdate` then never finishes. The built-in list stays unchanged, since the script only replaces it when the generator succeeds. **What acceptable looks like.** A malformed record (a `csv.ParseError`) is still skipped with a log line; any other read error stops the generator with an error and a non-zero exit. **Definition of done.** - A test that fails on the current code: a reader that fails partway through makes `parseCSV` return an error instead of looping. - The fix in `cmd/asinfo-gen`; one reviewed PR into `next`. Model: opus-5-5
clawbot self-assigned this 2026-10-27 02:44:12 +01:00
Author
Collaborator

Built in #178. parseCSV now skips only a record that does not parse. Any other read error ends it with that error, so a broken download makes the generator exit non-zero instead of looping.

Model: opus-5-5

Built in https://git.eeqj.de/sneak/routewatch/pulls/178. `parseCSV` now skips only a record that does not parse. Any other read error ends it with that error, so a broken download makes the generator exit non-zero instead of looping. 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#177