Skip to content

Improving auto warm up time#1576

Merged
Mzack9999 merged 1 commit intodevfrom
bugfix-1574-warm-up-time
Oct 30, 2025
Merged

Improving auto warm up time#1576
Mzack9999 merged 1 commit intodevfrom
bugfix-1574-warm-up-time

Conversation

@Mzack9999
Copy link
Copy Markdown
Member

@Mzack9999 Mzack9999 commented Oct 30, 2025

Summary by CodeRabbit

  • Bug Fixes
    • Enhanced warm-up delay configuration with a minimum 2-second guarantee for consistent timing behavior.
    • Added validation to automatically correct invalid warm-up time settings, preventing potential configuration issues.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Oct 30, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

Refactors the warm-up timing mechanism to enforce a minimum 2-second duration. Validation logic validates and corrects invalid WarmUpTime values, while the runner adjusts when the sleep occurs during enumeration, ensuring consistent warm-up behavior regardless of initial configuration.

Changes

Cohort / File(s) Summary
Warm-up timing validation
pkg/runner/validate.go
Added validation in ValidateOptions to enforce minimum 2-second warm-up duration; when WarmUpTime ≤ 0, a debug log is emitted and WarmUpTime is set to 2
Warm-up timing execution
pkg/runner/runner.go
Refactored RunEnumeration to introduce warmUpTime variable with 2-second default; sleep now deferred until after host discovery using the validated warmUpTime value

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Review the validation logic in ValidateOptions to confirm the fallback behavior aligns with expectations
  • Verify the sleep timing in RunEnumeration occurs at the correct point in the host discovery sequence
  • Confirm existing tests cover both the validation correction and the deferred sleep behavior

Poem

🐰 Hop hop, let's settle in—
Two seconds warm, before we begin,
No more zero or negative fuss,
The validator corrects it for us!
Sleep deferred, discovery first,
The timing's now quenched, no longer thirst!

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch bugfix-1574-warm-up-time

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d094eb4 and 46ce464.

📒 Files selected for processing (2)
  • pkg/runner/runner.go (1 hunks)
  • pkg/runner/validate.go (1 hunks)

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
Copy link
Copy Markdown
Member Author

@coderabbitai create an issue for this PR related to improving auto-handling warm up time with SYN scan

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Oct 30, 2025

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Get PR details
gh pr view 1576 --json title,body,url

Length of output: 109


🏁 Script executed:

#!/bin/bash
# Create GitHub issue for improving auto-handling warm up time with SYN scan
gh issue create \
  --title "Improve auto-handling of warm up time with SYN scan" \
  --body "This issue tracks improvements to auto-handling warm up time with SYN scan.

Related to PR #1576: https://github.com/projectdiscovery/naabu/pull/1576

Requested by: @Mzack9999" \
  --assignee Mzack9999

Length of output: 53


@Mzack9999: I've created issue #1577 to track improvements for auto-handling warm up time with SYN scan.

Issue link: #1577

The issue has been assigned to you and includes a reference back to PR #1576.

@Mzack9999 Mzack9999 marked this pull request as ready for review October 30, 2025 12:10
@Mzack9999 Mzack9999 merged commit 4cd118b into dev Oct 30, 2025
13 checks passed
@Mzack9999 Mzack9999 deleted the bugfix-1574-warm-up-time branch October 30, 2025 12:10
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.

Improve auto-handling of warm up time with SYN scan Scanning of two ports does not display the scan results.

1 participant