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 and the updates sent
while it reconnected were lost. The scanner now accepts lines up to 1 MiB
(maxLineSize), well above an extended BGP message written out as the feed
writes it.

Model: opus-5-5
This commit was merged in pull request #89.
This commit is contained in:
2026-10-19 11:49:47 +02:00
parent 825afa2ebe
commit 4f515d718b
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
@@ -573,6 +574,7 @@ func (s *Streamer) stream(ctx context.Context) error {
}()
scanner := bufio.NewScanner(reader)
scanner.Buffer(nil, maxLineSize)
for scanner.Scan() {
idleTimer.Reset(s.idleTimeout)