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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user