Skip to content

Move parallelProbes from worker config to ScanConfig#72

Open
p-huynh wants to merge 3 commits intomainfrom
refactor/parallel-probes-from-worker-to-scanconfig
Open

Move parallelProbes from worker config to ScanConfig#72
p-huynh wants to merge 3 commits intomainfrom
refactor/parallel-probes-from-worker-to-scanconfig

Conversation

@p-huynh
Copy link
Copy Markdown
Contributor

@p-huynh p-huynh commented Apr 14, 2026

This PR moves parallelProbes, introduced in #69, from worker configuration to scan configuration:

  • Added parallelProbes to controller-side scan creation (ControllerCommandConfig -> ScanConfig).
  • Removed worker-side -parallelProbes from WorkerCommandConfig.
  • Workers now read/apply parallelProbes from job scan config, with fallback to 1 for invalid values.

@p-huynh p-huynh requested a review from XoMEX April 14, 2026 14:24
Comment on lines +249 to +250
ScanConfig scanConfig = getScanConfig();
scanConfig.setParallelProbes(getParallelProbes());
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Inconsistent with how we set the other parameters.

Comment on lines +157 to +159
if (scanJobDescription.getBulkScanInfo().getScanConfig().getParallelProbes() <= 0) {
scanJobDescription.getBulkScanInfo().getScanConfig().setParallelProbes(1);
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This should just error early on


private int timeout;

private int parallelProbes = 1;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why does this have a default value?

*/
protected ScanConfig(ScannerDetail scannerDetail, int reexecutions, int timeout) {
this(scannerDetail, reexecutions, timeout, null);
this(scannerDetail, reexecutions, timeout, 1, null);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Handle it like the other ones: Expect it as an argument.
(Maybe we want to change to a builder pattern at some point)

Comment on lines +61 to 72
protected ScanConfig(
ScannerDetail scannerDetail,
int reexecutions,
int timeout,
int parallelProbes,
List<ProbeType> excludedProbes) {
this.scannerDetail = scannerDetail;
this.reexecutions = reexecutions;
this.timeout = timeout;
this.parallelProbes = parallelProbes;
this.excludedProbes = excludedProbes;
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Just keep this constructor. Yes it is a breaking change, but the only "user" is TLS-Crawler (and maybe SSH Crawler)

@p-huynh p-huynh requested a review from XoMEX April 16, 2026 12:02
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.

2 participants