The prune test gains a third prefix with more than 500 rows newer than 72 hours, and checks every newer row survives and every older one is deleted, in a helper shared by the three prefixes. The prefix page test uses an origin AS the routing table does not carry. README's limit list says the routing table drops the oldest waiting origin changes past 100,000, and the prefix page entry says the page shows at most the newest 5,000. The tests read 5,000 and 100,000 from named limits instead of bare numbers, so the routing table's waiting cap is now exported for them. Model: deepseek-v4-pro
This commit is contained in:
@@ -6,10 +6,10 @@ import (
|
||||
"time"
|
||||
)
|
||||
|
||||
// maxWaitingOriginChanges is the most origin changes the table keeps waiting
|
||||
// MaxWaitingOriginChanges is the most origin changes the table keeps waiting
|
||||
// for the prefix handler to write. The oldest change past it is dropped and
|
||||
// counted.
|
||||
const maxWaitingOriginChanges = 100000
|
||||
const MaxWaitingOriginChanges = 100000
|
||||
|
||||
// OriginChange is one change of a prefix and origin AS pair: the origin AS
|
||||
// gained its first peer, or lost its last.
|
||||
@@ -76,7 +76,7 @@ func (t *Table) PutBackOriginChanges(changes []OriginChange) {
|
||||
// trimOriginChanges drops the oldest origin changes past the cap and counts
|
||||
// them. The caller holds the lock.
|
||||
func (t *Table) trimOriginChanges() {
|
||||
if extra := len(t.originChanges) - maxWaitingOriginChanges; extra > 0 {
|
||||
if extra := len(t.originChanges) - MaxWaitingOriginChanges; extra > 0 {
|
||||
t.originChangesDropped += extra
|
||||
t.originChanges = t.originChanges[extra:]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user