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

reboot operation #11

Merged
merged 7 commits into from
Oct 4, 2023
Merged

reboot operation #11

merged 7 commits into from
Oct 4, 2023

Conversation

prinikasn
Copy link
Collaborator

@prinikasn prinikasn commented Sep 27, 2023

PR for the Reboot Operation

@prinikasn prinikasn marked this pull request as ready for review September 29, 2023 18:25
system/system.go Outdated Show resolved Hide resolved
}

// IgnoreUnavailableErr ignores unavailable errors returned by reboot status.
func (r *RebootOperation) IgnoreUnavailableErr(ignoreUnavailableErr bool) *RebootOperation {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we just drop this and always ignore UnavailableErrors when waiting for active

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

hmmm.. is UnavailableError always acceptable after reboot?

Having a function to ignore the error gives the flexibility to ignore errors based on the usecase.

I do see a test here which performs a reboot and expects error to be nil -> https://github.com/openconfig/featureprofiles/blob/main/feature/gnoi/system/tests/chassis_reboot_status_and_cancel_test/chassis_reboot_status_and_cancel_test.go#L168

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, I see the pros and cons. Three comments:

First, It just seems to me that the likelihood that we would see an unexpected Unavailable error it is very low, especially given that the prior RebootRequest must have succeeded by then. Other errors would obviously still be reported.

Second, almost all uses of WaitForActive(true) is going to want to be accompanied by IgnoreUnavailableErr(true), because nearly all will be rebooting the chassis, and if not that the management linecard. So I feel like IgnoreUnavailableErr(true) is going to be one of these lines people just copy and paste everywhere anyway, regardless of whether they need it, because that's what most calls look like.

Third, I'm holding out some hope that we can extend the RebootRequestResponse to make IgnoreUnavailableErr eventually unnecessary. I'm going to be starting a thread on the OpenConfig chat about that.

Due to those three, I was feeling like IgnoreUnavailableErr maybe isn't offering enough to pull its weight. All that said, I still see the reasons for including it, so I'm fine with you leaving it in if you prefer to keep it.

system/system_test.go Outdated Show resolved Hide resolved
system/system_test.go Outdated Show resolved Hide resolved
}

// IgnoreUnavailableErr ignores unavailable errors returned by reboot status.
func (r *RebootOperation) IgnoreUnavailableErr(ignoreUnavailableErr bool) *RebootOperation {
Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, I see the pros and cons. Three comments:

First, It just seems to me that the likelihood that we would see an unexpected Unavailable error it is very low, especially given that the prior RebootRequest must have succeeded by then. Other errors would obviously still be reported.

Second, almost all uses of WaitForActive(true) is going to want to be accompanied by IgnoreUnavailableErr(true), because nearly all will be rebooting the chassis, and if not that the management linecard. So I feel like IgnoreUnavailableErr(true) is going to be one of these lines people just copy and paste everywhere anyway, regardless of whether they need it, because that's what most calls look like.

Third, I'm holding out some hope that we can extend the RebootRequestResponse to make IgnoreUnavailableErr eventually unnecessary. I'm going to be starting a thread on the OpenConfig chat about that.

Due to those three, I was feeling like IgnoreUnavailableErr maybe isn't offering enough to pull its weight. All that said, I still see the reasons for including it, so I'm fine with you leaving it in if you prefer to keep it.

@prinikasn prinikasn merged commit 591eb9c into main Oct 4, 2023
3 checks passed
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.

2 participants