greenbone / ospd

OSPd is a framework for vulnerability scanners which share the same communication protocol: OSP (Open Scanner Protocol)
GNU Affero General Public License v3.0
30 stars 36 forks source link

Fix resume task. #464

Closed jjnicola closed 2 years ago

jjnicola commented 2 years ago

What: Fix resume task

Why: In some cases, the task is stopped and quickly resumed. In this cases there was race condition in which the scan id is present in the scan table but there is no target information. Although the quick resume can lead first into a stopped and scan followed by an interrupted scan, finally the scan can be resumed.

How: Start, stop and resume task, until you get the interrupted scan. With the patch, resuming the task should finally work and the scan should end successfully.

Checklist:

codecov[bot] commented 2 years ago

Codecov Report

Merging #464 (d4bf472) into ospd-21.04 (f5c6222) will decrease coverage by 0.02%. The diff coverage is 66.66%.

Impacted file tree graph

@@              Coverage Diff               @@
##           ospd-21.04     #464      +/-   ##
==============================================
- Coverage       74.67%   74.65%   -0.03%     
==============================================
  Files              23       23              
  Lines            2638     2643       +5     
==============================================
+ Hits             1970     1973       +3     
- Misses            668      670       +2     
Impacted Files Coverage Δ
ospd/scan.py 92.45% <66.66%> (-0.63%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update f5c6222...d4bf472. Read the comment docs.