-
Notifications
You must be signed in to change notification settings - Fork 6
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
Error handling; don't panic. #61
Merged
Merged
Conversation
This file contains 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
- feat: added done and error channels in sparrow - feat: added global shutdown function for main components - chore: edited most functions to return errors and not panic
Signed-off-by: Bruno Bressi <[email protected]>
Signed-off-by: Bruno Bressi <[email protected]>
Signed-off-by: Bruno Bressi <[email protected]>
Signed-off-by: Bruno Bressi <[email protected]>
puffitos
requested review from
y-eight,
niklastreml,
lvlcn-t and
eumel8
as code owners
January 5, 2024 18:07
puffitos
added
feature
Introduces a new feature
refactoring
Refactoring of existing code
labels
Jan 5, 2024
Signed-off-by: Bruno Bressi <[email protected]>
Ready for review. |
Signed-off-by: Bruno Bressi <[email protected]>
niklastreml
reviewed
Jan 12, 2024
Signed-off-by: Bruno Bressi <[email protected]>
Signed-off-by: Bruno Bressi <[email protected]>
lvlcn-t
reviewed
Jan 14, 2024
Signed-off-by: Bruno Bressi <[email protected]>
niklastreml
approved these changes
Jan 16, 2024
lvlcn-t
approved these changes
Jan 16, 2024
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.
LGTM, thanks for the call
y-eight
approved these changes
Jan 16, 2024
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.
Motivation
Addresses #53
Still a WIP. I just wanted to put everything together as documentation so we can discuss this together next week.
Changes
A friendly guide for the changes:
Run
and write their errors into the error channel (when something irrecoverable happens)handleErrors
), which may be extended to handle errors in other ways (currently only fatal errors are expected in the error channel)handleErrors
will gracefully shutdown all sparrow components (if possible) and return the error(s) which led to the shutdown, along with other errors that happened during shutdown.Additionally, I couldn't resist the urge and did the following (sorry!):
withGroup
from all loggersTests done
Normal run, metrics from remote config
Cancel context after 30 secs
A timeout context was set in the top-level sparrow.Run(ctx) call. After running for a bit, we get the following logs. Note the many errors in the various checks, the api shutdown and the target manager shutdown. Finally, sparrow exits with 1 as it should :)
TODO