-
Notifications
You must be signed in to change notification settings - Fork 397
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
Ability to provide listener for unhandled execution errors #1119
base: master
Are you sure you want to change the base?
Conversation
Lists.newArrayList(registry.getAll(ExecutionErrorListener.class)); | ||
|
||
controller.fork() | ||
.onComplete(e -> { |
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.
this allows us to pause the originating execution while the ExecutionErrorListener
instances are working; then once they have completed, this will properly close off the original execution.
This is necessary to preserve the functionality that error handlers are invoked prior to the execution's onComplete
handler.
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.
We should try to avoid this. We already had the behaviour of executing the error handlers before the on complete handler. What broke about that?
@@ -160,7 +160,7 @@ public ExecStarter eventLoop(EventLoop eventLoop) { | |||
|
|||
@Override | |||
public ExecStarter onError(Action<? super Throwable> onError) { | |||
this.onError = onError; | |||
this.errorListeners.add((e, t) -> onError.execute(t)); |
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.
with this, multiple onError
calls can be made and they will all be fired on an error. This may constitute a breaking behavior change.
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.
@danveloper why do we need to have this multiple error handler behaviour?
failing specs:
|
I have merged master into this. Let's get this into 1.6. |
@danveloper I would like to make a couple of changes.
Other than that, I think we are good to merge (once we fix the tests). |
For 1: how would you like to handle the addition of the error handlers? Via the registry? For 2: how do we ensure the error handlers run inside an execution? The current execution is complete by the time the error handlers would be invoked. |
I'll make both changes today. |
7de480c
to
7b5b3ec
Compare
Is this still queued up for 1.6? |
@gschrader it's set to be reviewed this week and included if seems reasonable |
I'll look at removing the additive behavior next then I think this will have all its tests passing. |
Move things around and fix codenarc error
f7c57d9
to
cc214d6
Compare
906d699
to
48f9b48
Compare
@beckje01 is there outstanding things on this PR? running locally it isn't failing, and I've been seeing some strange timing issues out of circleci lately so it might be worth just re-triggering this to see if you just hit a hiccup. |
…t of the ErrorListener)
This commit provides the means by which users can add one or many
ExecutionErrorListener
instances to an execution registry. Furthermore it extends the capabilities ofExecStarter#onError
to allow multiple error handlers to be specified in a forked execution.Users will be able to use this feature to provide a handler that will capture any uncaught exceptions in an execution, and do further processing in a new execution.
This change is