cisagov / crossfeed

External monitoring for organization assets
https://docs.crossfeed.cyber.dhs.gov
Creative Commons Zero v1.0 Universal
356 stars 54 forks source link

A Pending Scan Task Freezes the Queue if its Associated Scan is Deleted #2596

Open Matthew-Grayson opened 4 months ago

Matthew-Grayson commented 4 months ago

🐛 Summary

If a scan task is pending when its associated scan is deleted, the queuing system will freeze and prevent other scans from running.

To reproduce

As a Global User, navigate to the scans pages and create a scan. Click the run button several times and delete the scan. Create a new scan and click the run button. Confirm that the new scan doesn't run. You may also look at the scan_task table to confirm that the old scan tasks have a pending status.

Expected behavior

I suggest we add logic to the scheduler to mark the orphaned scan tasks as finished and/or delete them.