Stop decoding unused Community and Raw fields of RIS messages #18

Merged
clawbot merged 1 commits from issue-9-drop-community-raw into next 2026-09-21 16:12:42 +02:00
Collaborator

Part of #3 (memory plan, unit U3), closes #9.

Community and Raw on RISMessage (internal/ristypes/ris.go) are decoded from every live message and read by no handler; Raw is the hex of the whole BGP message. Each parsed message sits in up to four handler queues, so retaining them is a large share of queue memory.

Change: both fields are now tagged json:"-" so they stay empty after decoding. I kept the fields (rather than removing them) because the definition of done asks for a test that observes them empty, which needs the fields to exist; a short comment on them warns against re-decoding without a consumer.

I confirmed by reading the tree that nothing outside this file references either field.

New test internal/ristypes/ris_test.go decodes every message in docs/message-examples.json the way the streamer does and asserts Community and Raw stay empty while used fields (Path, Announcements) still populate.

Disclosure (judgement call): the host make check cannot lint here — the host has Go 1.26 with a golangci-lint built against Go 1.25, which panics on Go 1.26 export data regardless of any change. Per policy the authoritative gate is the pinned Docker lint stage; I ran script/cibuild, whose lint, fmt-check and test stages executed fresh on this change and passed.

Model: opus-4-8

Part of https://git.eeqj.de/sneak/routewatch/issues/3 (memory plan, unit U3), closes https://git.eeqj.de/sneak/routewatch/issues/9. `Community` and `Raw` on `RISMessage` (`internal/ristypes/ris.go`) are decoded from every live message and read by no handler; `Raw` is the hex of the whole BGP message. Each parsed message sits in up to four handler queues, so retaining them is a large share of queue memory. Change: both fields are now tagged `json:"-"` so they stay empty after decoding. I kept the fields (rather than removing them) because the definition of done asks for a test that observes them empty, which needs the fields to exist; a short comment on them warns against re-decoding without a consumer. I confirmed by reading the tree that nothing outside this file references either field. New test `internal/ristypes/ris_test.go` decodes every message in `docs/message-examples.json` the way the streamer does and asserts `Community` and `Raw` stay empty while used fields (`Path`, `Announcements`) still populate. Disclosure (judgement call): the host `make check` cannot lint here — the host has Go 1.26 with a golangci-lint built against Go 1.25, which panics on Go 1.26 export data regardless of any change. Per policy the authoritative gate is the pinned Docker lint stage; I ran `script/cibuild`, whose lint, fmt-check and test stages executed fresh on this change and passed. Model: opus-4-8
clawbot added 1 commit 2026-09-21 15:44:07 +02:00
Community and Raw are decoded from every live message and read by no
handler; Raw is the hex of the whole BGP message. Each parsed message
sits in up to four handler queues, so retaining them is a large share of
queue memory. Tagging both json:"-" keeps them out of the decoded
message while the fields handlers use still decode. A decode test over
docs/message-examples.json confirms both stay empty and the used fields
(Path, Announcements) still populate.

Model: opus-4-8
clawbot added the needs-review label 2026-09-21 15:44:18 +02:00
clawbot self-assigned this 2026-09-21 15:44:18 +02:00
Author
Collaborator

PASS — both Community and Raw are tagged json:"-", nothing outside the type reads either field, and the new decode test over docs/message-examples.json meaningfully asserts both stay empty while the used fields (Path, Announcements) still populate, with the pinned Docker gate green on the head rebased onto current next.

Model: opus-4-8

PASS — both `Community` and `Raw` are tagged `json:"-"`, nothing outside the type reads either field, and the new decode test over `docs/message-examples.json` meaningfully asserts both stay empty while the used fields (`Path`, `Announcements`) still populate, with the pinned Docker gate green on the head rebased onto current `next`. Model: opus-4-8
clawbot removed the needs-review label 2026-09-21 16:07:30 +02:00
clawbot merged commit cb2374f033 into next 2026-09-21 16:12:42 +02:00
clawbot deleted branch issue-9-drop-community-raw 2026-09-21 16:12:42 +02:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/routewatch#18