Skip to content

Fix/timeout flag not working#1723

Merged
dogancanbakir merged 4 commits intoprojectdiscovery:devfrom
recepgunes1:fix/timeout-flag-not-working
Feb 5, 2026
Merged

Fix/timeout flag not working#1723
dogancanbakir merged 4 commits intoprojectdiscovery:devfrom
recepgunes1:fix/timeout-flag-not-working

Conversation

@recepgunes1
Copy link
Contributor

@recepgunes1 recepgunes1 commented Feb 2, 2026

/claim #1560

Proposed changes

Proof

Checklist

  • Pull request is created against the dev branch
  • All checks passed (lint, unit/integration/regression tests etc.) with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

Summary by CodeRabbit

  • New Features
    • Introduced session-level timeout configuration that enables users to set request timeouts in seconds, with automatic enforcement on database connections to improve reliability and prevent hanging requests during subscraping operations.

@coderabbitai
Copy link

coderabbitai bot commented Feb 2, 2026

Walkthrough

This PR adds timeout support to the subscraping library. A new Timeout field is introduced to the Session struct, initialized during session creation, and used to configure PostgreSQL connection and statement timeouts dynamically in the crtsh source module.

Changes

Cohort / File(s) Summary
Type Definition
pkg/subscraping/types.go
Adds public Timeout field (int) to Session struct, representing timeout in seconds.
Session Initialization
pkg/subscraping/agent.go
Initializes Timeout field in NewSession's Session composite literal alongside Client field.
Database Configuration
pkg/subscraping/sources/crtsh/crtsh.go
Replaces hardcoded PostgreSQL connection string with dynamic one that enforces connect_timeout and statement_timeout using session.Timeout via fmt.Sprintf.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 A timeout field hops into view,
Through Session and Agent it flows on through,
PostgreSQL waits with patience set right,
No more hardcoded strings in the night!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Fix/timeout flag not working' directly relates to the main change: implementing timeout functionality that can be controlled via a flag, as evidenced by the addition of the Timeout field to Session and its usage in database connection configuration.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

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

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

@recepgunes1
Copy link
Contributor Author

golangci/golangci-lint throws exception because of projectdiscovery package's, would you help me ? @dogancanbakir

@dogancanbakir
Copy link
Member

@coderabbitai create an issue to track failing check for lint

@dogancanbakir
Copy link
Member

@recepgunes1 ignore the failing check

@coderabbitai
Copy link

coderabbitai bot commented Feb 3, 2026

Tip

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

🧩 Analysis chain

@dogancanbakir, I'll create an issue to track the failing lint check. Let me first gather information about the failure.


🏁 Script executed:

#!/bin/bash
# Check the PR status and CI checks to understand the lint failure
gh pr view 1723 --json statusCheckRollup --jq '.statusCheckRollup[] | select(.context | contains("lint")) | {context: .context, state: .state, conclusion: .conclusion, detailsUrl: .detailsUrl}'

# Also get the PR URL for reference
gh pr view 1723 --json url --jq '.url'

Length of output: 99


🏁 Script executed:

#!/bin/bash
# Get all status checks to see the lint failure
gh pr view 1723 --json statusCheckRollup --jq '.statusCheckRollup[] | {name: .name, context: .context, state: .state, conclusion: .conclusion}'

# Get PR details
gh pr view 1723 --json title,number,url,author --jq '{title: .title, number: .number, url: .url, author: .author.login}'

Length of output: 719


🏁 Script executed:

#!/bin/bash
# Create an issue to track the failing lint check
gh issue create \
  --title "Lint Check Failing in CI Pipeline" \
  --body "## Description

The golangci-lint check is currently failing in the CI pipeline. According to initial investigation, the failure appears to be related to projectdiscovery package dependencies.

## Context

This issue was identified during the review of PR `#1723`.

**Related PR:** https://github.com/projectdiscovery/subfinder/pull/1723
**Discussion:** https://github.com/projectdiscovery/subfinder/pull/1723#discussion_r_placeholder

**CI Check Status:** The 'Lint Test' check is currently returning a FAILURE status.

**Reported by:** `@recepgunes1`
**Requested by:** `@dogancanbakir`

## Next Steps

- Investigate the specific golangci-lint errors
- Determine if the issue is with projectdiscovery package dependencies
- Resolve the lint failures to unblock the CI pipeline" \
  --assignee dogancanbakir

# Get the created issue number
gh issue list --limit 1 --json number,title,url --jq '.[0]'

Length of output: 183


@dogancanbakir, I've created issue #1730 to track the failing lint check.

Issue: Lint Check Failing in CI Pipeline

The issue documents:

  • The current "Lint Test" failure in the CI pipeline
  • Context from this PR and the discussion about golangci-lint throwing exceptions related to projectdiscovery packages
  • Next steps for investigation and resolution

The issue has been assigned to you for tracking and resolution.

@dogancanbakir dogancanbakir self-requested a review February 3, 2026 15:11
@dogancanbakir
Copy link
Member

@recepgunes1 Could you make sure the PR is complete by filling the template:

Proposed changes

Describe the overall picture of your modifications to help maintainers understand the pull request. PRs are required to be associated to their related issue tickets or feature request.

Proof

How has this been tested? Please describe the tests that you ran to verify your changes.

Checklist

Put an "x" in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

  • Pull request is created against the dev branch
  • All checks passed (lint, unit/integration/regression tests etc.) with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

Copy link
Member

@dogancanbakir dogancanbakir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update the description by adding the proof and including the checklist.

@Jigardjain
Copy link
Contributor

Jigardjain commented Feb 3, 2026

@recepgunes1 Can you please rebase onto latest dev branch to include the lint fix. The golangci-lint check is failing in PR #1723 due to a deprecated package import that exists in an older version of the codebase. The fix for this issue already exists on the dev branch but PR #1723 is based on an outdated commit.
F.Y.I @dogancanbakir

@recepgunes1
Copy link
Contributor Author

i've updated, fyi @Jigardjain

@dogancanbakir dogancanbakir merged commit 2d4f804 into projectdiscovery:dev Feb 5, 2026
10 checks passed
@dogancanbakir dogancanbakir linked an issue Feb 5, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Issue] Timeout flag does not work consistently

4 participants