Skip to content
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

[module] Suggestions for #1275 #1308

Merged

Conversation

huitseeker
Copy link
Contributor

This shows an IrrecoverableErrorHandler, with (separate) integration into context and RunComponent + ReadyDoneAware.

Possibly superfluous:

  • type assertions to be able to use a function on Context instances that are actually IrrecoverableSignalerContext,

Possibly missing:

  • do we need to demo more in the component. E.g. RunComponent may demo cleanup, etc?

Possibly superfluous:
- type assertions to be able to use a function on Context instances that are actually IrrecoverableSignalerContext,

Possibly missing:
- do we need to demo more in the component. E.g. RunComponent may demo cleanup, etc?
module/errorhandler/erroraware.go Outdated Show resolved Hide resolved
module/errorhandler/erroraware.go Outdated Show resolved Hide resolved
module/errorhandler/erroraware.go Outdated Show resolved Hide resolved
module/errorhandler/erroraware.go Outdated Show resolved Hide resolved
module/errorhandler/erroraware.go Outdated Show resolved Hide resolved
module/errorhandler/erroraware.go Outdated Show resolved Hide resolved
module/errorhandler/erroraware.go Outdated Show resolved Hide resolved
module/errorhandler/erroraware.go Outdated Show resolved Hide resolved
module/errorhandler/erroraware.go Outdated Show resolved Hide resolved
Copy link
Contributor

@synzhu synzhu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @huitseeker, pretty excited about this :)

Just one last comment, otherwise it looks good!

// shutdown the component,
cancel()
// wait until it's doneC
<-done
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While we are waiting for done, its possible the parentCtx could be cancelled.

In this case, we should abort waiting for shutdown to complete and exit the function. Otherwise, we will still proceed to the handler(err, restart) below even though the parent ctx is cancelled.

I think we just need an additional select statement wrapping this <-done.

@huitseeker huitseeker merged commit 2e8bca3 into onflow:smnzhu/error-handling Sep 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants