-
Notifications
You must be signed in to change notification settings - Fork 478
Added Zombie and Cleaning Scan states #4983
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -49,6 +49,8 @@ enum ScanState { | |
| IDLE | ||
| RUNNING | ||
| QUEUED | ||
| ZOMBIE | ||
| CLEANING | ||
| } | ||
|
|
||
| struct ActiveScan { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -458,34 +458,37 @@ public List<ActiveScan> getActiveScans() { | |
| addActiveScan(activeScans, scanSession, | ||
| isSingle ? ((SingleScanSession) scanSession).extent | ||
| : ((MultiScanSession) scanSession).threadPoolExtent, | ||
| ct, isSingle ? ScanType.SINGLE : ScanType.BATCH, | ||
| computeScanState(scanSession.getScanTask()), scanSession.scanParams, entry.getKey()); | ||
| ct, isSingle ? ScanType.SINGLE : ScanType.BATCH, computeScanState(scanSession), | ||
| scanSession.scanParams, entry.getKey()); | ||
| } | ||
| })); | ||
|
|
||
| return activeScans; | ||
| } | ||
|
|
||
| private ScanState computeScanState(ScanTask<?> scanTask) { | ||
| private ScanState computeScanState(ScanSession<?> session) { | ||
| ScanState state = ScanState.RUNNING; | ||
|
|
||
| if (scanTask == null) { | ||
| state = ScanState.IDLE; | ||
| if (session.getState() == State.REMOVED) { | ||
| state = ScanState.CLEANING; | ||
| } else { | ||
| switch (scanTask.getScanRunState()) { | ||
| switch (session.getScanTask().getScanRunState()) { | ||
|
Comment on lines
-472
to
+475
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This removes the null check for the scanTask and I think it would still be needed, however, I'm not sure where it would go especially considering my next comment |
||
| case QUEUED: | ||
| state = ScanState.QUEUED; | ||
| break; | ||
| case FINISHED: | ||
| state = ScanState.IDLE; | ||
| break; | ||
| case RUNNING: | ||
| if (session.getState() == State.REMOVED) { | ||
| state = ScanState.ZOMBIE; | ||
| } | ||
| break; | ||
|
Comment on lines
+483
to
+486
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The current logic is:
|
||
| default: | ||
| /* do nothing */ | ||
| break; | ||
| } | ||
| } | ||
|
|
||
| return state; | ||
| } | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.