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.
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
[FLIP] Component API #1167
[FLIP] Component API #1167
Changes from 12 commits
a9411bc
5649ce0
e023980
09a34d7
1d6e000
c0a6ca3
2445591
9d28e87
bb5158c
37e1fa8
0a1b9cd
58f869c
64be8cd
a587274
9172256
5d1bf48
5007170
9236106
e4b2e01
b72da24
1b37466
a54d62b
e557416
a93b46d
f99bf7f
e70f781
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Can you explain where
ErrorHandler
would work in your design, please?I'll try to explain the source of my confusion:
component.Errors()
), into which it feeds any irrecoverable errorserrorHandler
would then always need to doThere 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.
Hey @AlexHentschel, thanks for the comment. Please see #1275, which has a more up-to-date design for the error-handling part of this FLIP. I will actually be removing the error handling stuff from this FLIP, since it is already fully implemented in #1275 and any further discussion can happen there. In particular, see the example which illustrates how all of it works together.
Briefly, to answer your question, the idea is that if a component has experienced an irrecoverable error, it is not necessarily the case that it should always be restarted. For example, we may actually decide that the error cannot be fixed by a restart and should actually be propagated up the stack by throwing an irrecoverable error in the parent component as well. Or we may wish to do some additional cleanup / actions before restarting, such as firing an alert to pagerduty, logging the error, etc.
ErrorHandler
gives the parent component the power to decide how to handle errors in the child component. The key here is that the parent is the one who should decide how to handle an irrecoverable error that occurs in the child component. An irrecoverable error is, by definition, an error that the child component doesn't know how to handle (if it did, the error would be recoverable), so all it can do is tell the parent component about the error and hope the parent knows how to handle it (whether that be via restarting, propagating the error further up the stack, etc).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.
Would it be better to start the error handling logic before we start the component ? ... It probably doesn't matter ... just wondering
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.
As you said, it doesn't actually matter much. The reason I started it after is because we want to make sure the component actually starts up properly, otherwise we don't even need to consider this part.