Skip to content

Fix dispatcher race condition when multiple scan jobs are dispatched in one go#1740

Merged
netomi merged 3 commits intomainfrom
fix-dispatcher-race-condition
Apr 5, 2026
Merged

Fix dispatcher race condition when multiple scan jobs are dispatched in one go#1740
netomi merged 3 commits intomainfrom
fix-dispatcher-race-condition

Conversation

@netomi
Copy link
Copy Markdown
Contributor

@netomi netomi commented Apr 5, 2026

This fixes #1734.

The dispatcher uses a transaction when processing queued scan jobs, which means that any change that is performed while dispatching the queued jobs will not be visible directly, but only when the transaction is committed.

Now it can happen that the dispatched jobs start right away while the dispatcher has not finished yet, but their status will still be queued instead of processing which results in a state where the job just returns but is not dispatched again.

This change should avoid that such that when a scan job is ready to be dispatched, the state is immediately changed to processing before enqueuing the respective job.

@netomi
Copy link
Copy Markdown
Contributor Author

netomi commented Apr 5, 2026

Additionally the method ExtensionScanCompletionService.checkCompletionSafely has been made Transactional as it calls a method in the same class that is Transactional to ensure that a transaction is really created.

@netomi
Copy link
Copy Markdown
Contributor Author

netomi commented Apr 5, 2026

@janbro

…nner for easier tracability, remove unused methods.
@netomi netomi merged commit 5df90a5 into main Apr 5, 2026
8 checks passed
@netomi netomi deleted the fix-dispatcher-race-condition branch April 5, 2026 19:24
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.

Publication scan wrongly times out

2 participants