Fix failing upgrade command when gRPC server interrupts connection#4519
Merged
rdner merged 8 commits intoelastic:mainfrom Apr 6, 2024
Merged
Fix failing upgrade command when gRPC server interrupts connection#4519rdner merged 8 commits intoelastic:mainfrom
rdner merged 8 commits intoelastic:mainfrom
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.
Contributor
|
Pinging @elastic/elastic-agent (Team:Elastic-Agent) |
blakerouse
reviewed
Apr 5, 2024
blakerouse
approved these changes
Apr 5, 2024
Contributor
blakerouse
left a comment
There was a problem hiding this comment.
Looks good, thanks for the fix!
Member
Author
|
|
|
mergify bot
pushed a commit
that referenced
this pull request
Apr 6, 2024
…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)
Merged
4 tasks
rdner
added a commit
that referenced
this pull request
Apr 6, 2024
…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 <denis.rechkunov@elastic.co>
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

75.0% Coverage on New Code
0.0% Duplication on New Code
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/fragmentsusing the changelog tool- [ ] I have added an integration test or an E2E testRelated issues