Repository navigation
Prevent enrichment starvation and cancel stalled lookup batches - #156
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.