Read feed lines up to 1 MiB (closes #76)
check / check (push) Canceled after 0s

The streamer read the feed with a bufio.Scanner at its default limit of
64 KiB per line, so a longer line ended the connection with "token too
long" and the updates sent while it reconnected were lost. The scanner
now accepts lines up to 1 MiB, well above an extended BGP message
(RFC 8654) written as hex with its decoded prefixes.

Model: opus-5-5
This commit is contained in:
2026-10-19 09:28:12 +00:00
parent a0ddc0d254
commit f6373656ea
2 changed files with 33 additions and 1 deletions
+3 -1
View File
@@ -53,7 +53,8 @@ const (
metricsLogInterval = 10 * time.Second
bytesPerKB = 1024
bytesPerMB = 1024 * 1024
maxConcurrentHandlers = 800 // Maximum number of concurrent message handlers
maxLineSize = bytesPerMB // Well above an extended BGP message (RFC 8654) in hex plus its prefixes
maxConcurrentHandlers = 800 // Maximum number of concurrent message handlers
// Backpressure constants
backpressureThreshold = 0.5 // Start dropping at 50% queue utilization
@@ -569,6 +570,7 @@ func (s *Streamer) stream(ctx context.Context) error {
}()
scanner := bufio.NewScanner(reader)
scanner.Buffer(nil, maxLineSize)
for scanner.Scan() {
idleTimer.Reset(s.idleTimeout)