[VC-35738] Append errgroup errors to the error returned by Agent.Run#606
Merged
wallrj merged 2 commits intoVC-35738/featurefrom Nov 7, 2024
Merged
[VC-35738] Append errgroup errors to the error returned by Agent.Run#606wallrj merged 2 commits intoVC-35738/featurefrom
wallrj merged 2 commits intoVC-35738/featurefrom
Conversation
Signed-off-by: Richard Wall <richard.wall@venafi.com>
Signed-off-by: Richard Wall <richard.wall@venafi.com>
This was referenced Nov 6, 2024
maelvls
approved these changes
Nov 7, 2024
Member
maelvls
left a comment
There was a problem hiding this comment.
Well spotted! Thank you (al lot) for the well-written PR description. Always a delight.
I didn't write automated test for this because I feel like we will be refactoring and simplifying the agent Run code in future and I just want to get the logging sorted out.
Got it. I'm OK with the idea of deferring the additional automated tests to later.
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.
In #599 (comment) I caused a bug where the error from the errgroup Go routines is discarded rather than being logged and causing the process to exit.
How did I notice this bug? I noticed the problem while testing a revision of #603 where I wrapped nil DataGatherer.Run early return into an error...but was not seeing the resulting error. It turns out that is the wrong behaviour and I found an additional bug #605 so I have since reverted that change.
I didn't write automated test for this because I feel like we will be refactoring and simplifying the agent Run code in future and I just want to get the logging sorted out.
But I did test this manually as follows:
You can see a log message about the API server skipping the shutdown sequence because the server has already stopped due to port 8081 is already being occupied,
but the error from the errgroup Go routine is being lost.
This time the test fails because the errgroup error has been properly bubbled up to the main function.