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

Failing asynchronous event handlers do not produce error logs #372

Closed
benjaminknauer opened this issue Nov 14, 2023 · 2 comments
Closed
Assignees
Labels
in: event publication registry Event publication registry type: bug Something isn't working
Milestone

Comments

@benjaminknauer
Copy link
Contributor

Hello!

I came across this section of code and I think it might benefit from an Error Log here:

LOG.info("Invocation of listener {} failed with message {}. Leaving event publication uncompleted.",

If this should remain an Info Log, could you please provide some guidance on how to implement a global async exception logging for this? It would be really helpful if this could also be documented, so it's clear for other developers as well.

Thanks a lot!

@benjaminknauer
Copy link
Contributor Author

I think it is also reported in this issue: #311

Registering a custom exception handler also didn't work for me.

@odrotbohm odrotbohm changed the title Failing @Async EventHandlers do not produce Error-Logs Failing asynchronous event handlers do not produce error logs Nov 19, 2023
@odrotbohm odrotbohm self-assigned this Nov 19, 2023
@odrotbohm odrotbohm added this to the 1.1 GA milestone Nov 19, 2023
@odrotbohm odrotbohm added in: event publication registry Event publication registry type: bug Something isn't working labels Nov 19, 2023
odrotbohm added a commit that referenced this issue Nov 19, 2023
We now propagate potentially occurring exceptions in CompletionRegisteringAdvisor to make sure the standard exception handling facilities kick in, both for synchronous and asynchronous listener invocations.

This implies that during republication we need to handle exceptions to make sure that failing synchronous listeners to not prevent the submission of subsequent publications. We currently log such exceptions into error.
@odrotbohm
Copy link
Member

I've tweaked the advisor to propagate the exception now. This unfortunately has side effects on the republication of synchronous event publications, as they now need to be handled as well. I am currently replicating the behavior of SimpleAsyncUncaughtExceptionHandler by logging the exception to the error level. Going forward, I think we can introduce a strategy to allow plug in different ways of handling such exceptions during republications.

odrotbohm added a commit that referenced this issue Nov 19, 2023
We now propagate potentially occurring exceptions in CompletionRegisteringAdvisor to make sure the standard exception handling facilities kick in, both for synchronous and asynchronous listener invocations.

This implies that during republication we need to handle exceptions to make sure that failing synchronous listeners to not prevent the submission of subsequent publications. We currently log such exceptions into error.
odrotbohm added a commit that referenced this issue Nov 19, 2023
We now propagate potentially occurring exceptions in CompletionRegisteringAdvisor to make sure the standard exception handling facilities kick in, both for synchronous and asynchronous listener invocations.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: event publication registry Event publication registry type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants