Remove singletons from Nuclei engine (continuation of #6210)#6296
Remove singletons from Nuclei engine (continuation of #6210)#6296ehsandeep merged 50 commits intoprojectdiscovery:devfrom hdm:feat-5239-no-singleton-continued
Conversation
… feat-5239-no-singleton-continued
|
Important Review skippedMore than 25% of the files skipped due to max files limit. The review is being skipped to prevent a low-quality review. 50 files out of 157 files are above the max files limit of 100. Please upgrade to Pro plan to get higher limits. You can disable this status message by setting the ✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
|
Thanks for the review and fixes! |
* introducing execution id * wip * . * adding separate execution context id * lint * vet * fixing pg dialers * test ignore * fixing loader FD limit * test * fd fix * wip: remove CloseProcesses() from dev merge * wip: fix merge issue * protocolstate: stop memguarding on last dialer delete * avoid data race in dialers.RawHTTPClient * use shared logger and avoid race conditions * use shared logger and avoid race conditions * go mod * patch executionId into compiled template cache * clean up comment in Parse * go mod update * bump echarts * address merge issues * fix use of gologger * switch cmd/nuclei to options.Logger * address merge issues with go.mod * go vet: address copy of lock with new Copy function * fixing tests * disable speed control * fix nil ExecuterOptions * removing deprecated code * fixing result print * default logger * cli default logger * filter warning from results * fix performance test * hardcoding path * disable upload * refactor(runner): uses `Warning` instead of `Print` for `pdcpUploadErrMsg` Signed-off-by: Dwi Siswanto <git@dw1.io> * Revert "disable upload" This reverts commit 114fbe6. * Revert "hardcoding path" This reverts commit cf12ca8. --------- Signed-off-by: Dwi Siswanto <git@dw1.io> Co-authored-by: Mzack9999 <mzack9999@protonmail.com> Co-authored-by: Dwi Siswanto <git@dw1.io> Co-authored-by: Dwi Siswanto <25837540+dwisiswant0@users.noreply.github.com>
The `connectWithDSN` func used `db.Exec()` which implicitly uses `context.Background()`[1]. This caused the registered "nucleitcp" dialer callback to receive a ctx missing the `executionId`, leading to a panic during type assertion. Refactor `connectWithDSN` to accept `executionId` explicitly and use it to create a `context` for `db.PingContext()` (yeah, instead of `db.Exec()`). And, add a defensive check in the dialer callback to handle nil values gracefully. Fixes #6733 regression introduced in #6296. [1]: "Exec uses `context.Background` internally" - https://pkg.go.dev/database/sql#DB.Exec. Signed-off-by: Dwi Siswanto <git@dw1.io>
The `connectWithDSN` func used `db.Exec()` which implicitly uses `context.Background()`[1]. This caused the registered "nucleitcp" dialer callback to receive a ctx missing the `executionId`, leading to a panic during type assertion. Refactor `connectWithDSN` to accept `executionId` explicitly and use it to create a `context` for `db.PingContext()` (yeah, instead of `db.Exec()`). And, add a defensive check in the dialer callback to handle nil values gracefully. Fixes #6733 regression introduced in #6296. [1]: "Exec uses `context.Background` internally" - https://pkg.go.dev/database/sql#DB.Exec. Signed-off-by: Dwi Siswanto <git@dw1.io>
Proposed changes
This is an extension of @Mzack9999's PR at #6210
Additional changes include:
Closes #5239
Checklist