Commit ba5de3a
committed
refactor: switch _mark_seen eviction from clear() to pop() and raise cap to 512
Smooth out the overflow path: instead of dropping the entire set at
once when it hits the bound (which then re-emits warning-level logs
for every previously-deduped key on its next occurrence), evict one
arbitrary entry per insert past the bound. The cap effectively becomes
a recency window of size `_MAX_SEEN_LOGS`.
Also raises the bound from 256 to 512. Memory cost stays trivial
(~40 KB of short exception strings), but under sustained malformed-
packet pressure ops sees a steady trickle of new warnings rather than
a burst of re-emissions every few hundred packets.1 parent 85ac2ae commit ba5de3a
1 file changed
Lines changed: 5 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
| 42 | + | |
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
51 | 53 | | |
52 | 54 | | |
53 | 55 | | |
54 | 56 | | |
55 | | - | |
| 57 | + | |
56 | 58 | | |
57 | 59 | | |
58 | 60 | | |
| |||
0 commit comments