The routing table in memory now holds every route, so the two per-peer route tables go, with every write, delete, count and read that served them. The prefix handler applies each update to the table, writes the table's changes every second, and stores each new prefix with its first-seen time. The peer delete, its retry on the next flush and the updates held for it go too. The image's memory settings fit a full table of about 1 GB: GOMEMLIMIT of 2.5 GiB, a 512 MiB page cache for the writing connection, and SQLite heap limits of 768 MiB and 1 GiB. The README describes the new table, its database copy and the memory budget. Model: opus-5-5
This commit is contained in:
@@ -422,27 +422,9 @@ func TestIPLookupsReadPercentEncodedAddresses(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
// errASDetailsLookupFailed is what failingASDetailsDB answers every AS details
|
||||
// lookup with.
|
||||
var errASDetailsLookupFailed = errors.New("AS details lookup failed")
|
||||
|
||||
// failingASDetailsDB wraps a real store and fails every AS details lookup.
|
||||
type failingASDetailsDB struct {
|
||||
database.Store
|
||||
}
|
||||
|
||||
func (failingASDetailsDB) GetASDetailsContext(
|
||||
_ context.Context, _ int,
|
||||
) (*database.ASN, []database.LiveRoute, error) {
|
||||
return nil, nil, errASDetailsLookupFailed
|
||||
}
|
||||
|
||||
// TestPrefixDetailShowsOriginNames checks that the prefix page shows each
|
||||
// origin AS's handle and description without looking up the AS's details,
|
||||
// which also read every route the AS originates. Before the fix the page did
|
||||
// that lookup once per origin, so with it failing the names were missing
|
||||
// (https://git.eeqj.de/sneak/routewatch/issues/67). The AS path column shows
|
||||
// handles too, so the test looks for the origin list's "(handle)" form.
|
||||
// origin AS's handle and description. The AS path column shows handles too, so
|
||||
// the test looks for the origin list's "(handle)" form.
|
||||
func TestPrefixDetailShowsOriginNames(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
@@ -465,7 +447,7 @@ func TestPrefixDetailShowsOriginNames(t *testing.T) {
|
||||
announce(table, testPrefixV4, asn, testPeer(i+1), testRouteTime(0))
|
||||
}
|
||||
|
||||
s := New(failingASDetailsDB{db}, table,
|
||||
s := New(db, table,
|
||||
streamer.New(logger.New(), metrics.New()), logger.New(), &config.Config{})
|
||||
rec := httptest.NewRecorder()
|
||||
s.router.ServeHTTP(rec, httptest.NewRequestWithContext(
|
||||
|
||||
Reference in New Issue
Block a user