Skip to content

Prevent enrichment starvation and cancel stalled lookup batches - #156

Merged
lance0 merged 2 commits into
masterfrom
fix/enrichment-progress
Oct 16, 2026
Merged

lance0 merged 2 commits into
masterfrom
fix/enrichment-progress

Conversation

@lance0

@lance0 lance0 commented Oct 16, 2026 •

Copy link
Copy Markdown
Owner

When early hops have no reverse DNS or ASN result, each worker repeatedly spends its entire batch on those same addresses. Later hops never get a turn. The same pattern exists in GeoIP and IX enrichment. Shutdown also waits for an already-started DNS/ASN/IX batch to finish its network timeouts.

Exclude fresh negative cache entries before applying each worker's batch limit, while retaining IP deduplication and cached positive results for newly discovered sessions. Cancel in-flight lookup batches immediately on shutdown (tokio-util run_until_cancelled) and skip catch-up ticks after slow lookups.

Validation: full build/tests/clippy/fmt/doc checks and Rust 1.88 all-target check pass. Deterministic worker tests prefill ten misses followed by ten successes and verify later DNS, ASN and IX hops get enriched without any external queries. Additional regressions cover deduplication and cancellation of indefinitely pending lookup futures.

lance0 and others added 2 commits October 15, 2026 23:33
CancellationToken::run_until_cancelled already drops the in-flight batch on
shutdown, so the local lookup_batch helper is unnecessary. Keep DNS/ASN misses
cached for the existing hour: the starvation fix only needs fresh misses to be
skipped when filling a batch, and a 60s retry would re-query every unresolved
hop once a minute.
@lance0
lance0 marked this pull request as ready for review October 16, 2026 15:43
@lance0
lance0 merged commit 1bb6b68 into master Oct 16, 2026
6 checks passed
@lance0
lance0 deleted the fix/enrichment-progress branch October 16, 2026 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant