-
Notifications
You must be signed in to change notification settings - Fork 197
Fix failing upgrade command when gRPC server interrupts connection #4519
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
Fix failing upgrade command when gRPC server interrupts connection #4519
Conversation
The upgrade CLI command creates a client, connects to the Elastic Agent server and triggers the upgrade process which is supposed to shut down the agent and start the upgrade. Sometimes, this happens before the client gets a successful response and the upgrade command returns an error code although the upgrade succeeded. This change checks if the connection was interrupted and treats it as a successful result instead of error.
Pinging @elastic/elastic-agent (Team:Elastic-Agent) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks for the fix!
|
|
…4519) The upgrade CLI command creates a client, connects to the Elastic Agent server and triggers the upgrade process which is supposed to shut down the agent and start the upgrade. Sometimes, this happens before the client gets a successful response and the upgrade command returns an error code although the upgrade succeeded. This change checks if the connection was interrupted and treats it as a successful result instead of error. (cherry picked from commit 4ad7824)
…4519) (#4532) The upgrade CLI command creates a client, connects to the Elastic Agent server and triggers the upgrade process which is supposed to shut down the agent and start the upgrade. Sometimes, this happens before the client gets a successful response and the upgrade command returns an error code although the upgrade succeeded. This change checks if the connection was interrupted and treats it as a successful result instead of error. (cherry picked from commit 4ad7824) Co-authored-by: Denis <[email protected]>
What does this PR do?
The upgrade CLI command creates a client, connects to the Elastic Agent server and triggers the upgrade process which is supposed to shut down the agent and start the upgrade. Sometimes, this happens before the client gets a successful response and the upgrade command returns an error code although the upgrade succeeded.
This change checks if the connection was interrupted and treats it as a successful result instead of error.
Why is it important?
This race condition occasionally fails our integration tests.
Checklist
- [ ] I have made corresponding changes to the documentation- [ ] I have made corresponding change to the default configuration files./changelog/fragments
using the changelog tool- [ ] I have added an integration test or an E2E testRelated issues