Skip to content

better logging of dropped domains#969

Merged
Mzack9999 merged 1 commit intodevfrom
investigate/914-drop-analysis
Mar 21, 2026
Merged

better logging of dropped domains#969
Mzack9999 merged 1 commit intodevfrom
investigate/914-drop-analysis

Conversation

@Mzack9999
Copy link
Copy Markdown
Member

@Mzack9999 Mzack9999 commented Mar 21, 2026

Closes #914

Summary by CodeRabbit

  • New Features

    • Added warning notifications when domains fail DNS resolution and are excluded from processing results.
  • Bug Fixes

    • Improved stdin input handling when using file-based hosts or inline domain arguments.
    • Enhanced error detection and reporting for DNS query failures.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 21, 2026

Caution

Review failed

Pull request was closed or merged during review

Walkthrough

The runner now tracks domains that fail DNS resolution using an atomic counter, logging dropped domains during worker completion. Enhanced error handling in the worker captures DNS query errors and detects incomplete responses, systematically excluding problematic domains from processing.

Changes

Cohort / File(s) Summary
Domain Dropout Tracking
internal/runner/runner.go
Added droppedDomains atomic counter to Runner. Modified prepareInput() stdin handling to create temp files only when stdin exists without file-based hosts or inline domains. Both run() and runStream() now check the counter post-worker and warn to stderr if domains were dropped. Enhanced worker() error capture from DNS queries with nil-response and incomplete-field detection, incrementing the counter for skipped domains.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 A counter hops through DNS lands,
Tracking domains that slip through our hands—
No more silent drops in the night,
We log what's missing, set the output right!
One hundred sixty now match the result,
No hidden failures in our output cult! 🎉

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The PR adds diagnostics and logging to track dropped domains but does not fix the root cause of missing JSON output entries described in issue #914. The changes provide visibility into dropped domains through logging, but the PR should also ensure dropped domains are included in JSON output or justify their exclusion.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'better logging of dropped domains' directly addresses the implementation approach in the PR, which adds tracking and warning output for domains that fail DNS resolution.
Out of Scope Changes check ✅ Passed All changes are scoped to tracking and logging dropped domains related to DNS resolution failures, which directly supports investigating issue #914.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch investigate/914-drop-analysis

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Mzack9999 Mzack9999 merged commit 0ae0978 into dev Mar 21, 2026
11 of 12 checks passed
@Mzack9999 Mzack9999 deleted the investigate/914-drop-analysis branch March 21, 2026 11:19
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.

dnsx occasionally omits JSON output entries for some domains when querying ~160 domains, resulting in fewer host records than input

1 participant