You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Following similar issue (#938), the driver does not recover after getting TOPIC_AUTHORIZATION_FAILED as described as following:
To Reproduce
Have kafka server running with autoCreateTopic set to true but with an ACL denying creation of specific topic format.
Try to send a message using invalid topic (not allowed by ACL), the response would be TOPIC_AUTHORIZATION_FAILED.
Try to send a message using valid topic (already present on kafka), the response would be error, once it was not able to clean the targetTopics list from previous trial.
Expected behavior
The driver has to be able to recover to its safe state after receiving topic related errors when pushing messages to kafka.
Observed behavior
After the first error, the driver keeps the invalid topic inside targetTopics causing failures to any subsequent calls to push message to kafka.
Environment:
KafkaJS version latest
Kafka version 2.4
NodeJS version LTS
Solutions
We can add this error check (another statement inside if clause) and clean the list if we find them;
We can recover the list after any error trying to push messages to kafka.
There are some implications to the 2nd solution. Say for example the publisher is trying to push a message to invalid topic and there is network issue during the operation. The invalid topic would be present in targetTopics causing failure to subsequent calls not matter if they include valid or invalid topic.
Questions?
Is there a situation where we do not want to clean targetTopics ?
Describe the bug
Following similar issue (#938), the driver does not recover after getting TOPIC_AUTHORIZATION_FAILED as described as following:
To Reproduce
Have kafka server running with autoCreateTopic set to true but with an ACL denying creation of specific topic format.
targetTopics
list from previous trial.Expected behavior
The driver has to be able to recover to its safe state after receiving topic related errors when pushing messages to kafka.
Observed behavior
After the first error, the driver keeps the invalid topic inside
targetTopics
causing failures to any subsequent calls to push message to kafka.Environment:
Solutions
There are some implications to the 2nd solution. Say for example the publisher is trying to push a message to invalid topic and there is network issue during the operation. The invalid topic would be present in targetTopics causing failure to subsequent calls not matter if they include valid or invalid topic.
Questions?
Is there a situation where we do not want to clean targetTopics ?
kafkajs/src/cluster/index.js
Line 195 in d13acd5
Would it cause much trouble if we clean this list no matter what error we get while calling await this.refreshMetadata()?
kafkajs/src/cluster/index.js
Line 192 in d13acd5
Should we add every possible error to the
if
statement so we just recover the list on those cases?The fix is underway but I would like to get some input about this topic before submitting the request.
The text was updated successfully, but these errors were encountered: