Skip to content
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

Added Zombie and Cleaning Scan states #4983

Open
wants to merge 2 commits into
base: 3.1
Choose a base branch
from

Conversation

ArbaazKhan1
Copy link
Contributor

Added zombie and cleaning states to Admin and Thrift. Made methods to handle when the state is set to cleaning or zombie.

closes issue #4843

Comment on lines 472 to 475
if (session.getScanTask() == null) {
state = ScanState.IDLE;
} else {
switch (scanTask.getScanRunState()) {
switch (session.getScanTask().getScanRunState()) {
Copy link
Member

Choose a reason for hiding this comment

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

could store the scan task in a var

@kevinrr888 kevinrr888 added this to the 3.1.0 milestone Oct 17, 2024
Copy link
Member

@kevinrr888 kevinrr888 left a comment

Choose a reason for hiding this comment

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

A couple comments. The current logic doesn't look entirely correct to me but I'm not sure what should be changed.
@keith-turner - do you have any ideas/suggestions on my comments?

Comment on lines -472 to +475
if (scanTask == null) {
state = ScanState.IDLE;
if (session.getState() == State.REMOVED) {
state = ScanState.CLEANING;
} else {
switch (scanTask.getScanRunState()) {
switch (session.getScanTask().getScanRunState()) {
Copy link
Member

Choose a reason for hiding this comment

The 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

Comment on lines +483 to +486
if (session.getState() == State.REMOVED) {
state = ScanState.ZOMBIE;
}
break;
Copy link
Member

Choose a reason for hiding this comment

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

The current logic is:

    if (session.getState() == State.REMOVED) {
      state = ScanState.CLEANING;
    } else {
      ...
      if (session.getState() == State.REMOVED) {
        state = ScanState.ZOMBIE;
      }
      ...
    }

state = ScanState.ZOMBIE will never execute in this logic. It seems like either (or both) the logic for identifying ZOMBIE or CLEANING need to be changed (but I'm not sure which or what it should be changed to)

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.

3 participants