-
Notifications
You must be signed in to change notification settings - Fork 141
Open
Description
We see that if Hono encountes a Kafka AuthenticationException, it does not try to re-connect to the Kafka brokers and stops sending messages to any topic. This is a similar issue as #3544.
It seems Hono does not consider an AuthenticationException as a fatal error, which causes the cached producer to not be closed:
Lines 259 to 265 in 02b0a91
| public static boolean isFatalError(final Throwable error) { | |
| return error instanceof ProducerFencedException | |
| || error instanceof OutOfOrderSequenceException | |
| || error instanceof AuthorizationException | |
| || error instanceof UnsupportedVersionException | |
| || error instanceof UnsupportedForMessageFormatException; | |
| } |
If we apply the following patch to Hono we see it does correctly recover from such an exception:
public static boolean isFatalError(final Throwable error) {
return error instanceof ProducerFencedException
|| error instanceof OutOfOrderSequenceException
|| error instanceof AuthorizationException
+ || error instanceof AuthenticationException
|| error instanceof UnsupportedVersionException
|| error instanceof UnsupportedForMessageFormatException;
}- Are there any other Exceptions that should close the cached producer?
- Maybe we should just exclude exceptions that are non-fatal instead of determining what is fatal. If Kafka ever adds another fatal exception, some unexpected dangerous behavior could occur.
- Like stated hono constantly fails to publish messages to the kafka broker without being able to recover #3544, there are maybe other ways to determine if a cached producer needs to be closed. Like consecutive number of message that could not be produced, ...
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels