add default error cb to Admin, tweak producer and consumer error cb #343
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR Goal
Stop the following "error" via the
confluent_kafka
AdminClient
from logging (it's normal behavior, but is logged like or sounds like a problematic error).While my solution currently works, right now the
AdminClient
logger is broken to where defining any logger on it removes all its logged output (known issue), so I cannot prove this solution will continue to work when it's fixed, but it should be correct!Experimental change/idea
One thing I noticed was
KafkaError
has afatal()
method which doesn't really explain well what it means, but I thought it might be useful for figuring out better logging later, so I went ahead and included a minor change to log those slightly differently, and maybe we can see some patterns emerge and better hide errors that don't matter. Just an idea.I also changed the
error
log towarning
with the non-"fatal" errors, though IDK if they still basically come across as a "problem" regardless, but maybe it would help?Other notes from investigating this
log_level
producer/consumer config does not seem to alter logging at all.log.connection.close
does...maybe it's more relevant on the consumer side? Or the related logs show up in particular circumstances?debug
argument to producer/consumer/admin config in order to see confluent_kafka logs (confluent_kafka config values).INFO
modeconnections.max.idle.ms
(10s, 20s...never saw it at 3min)Producer timeouts
I considered including handling the logs that show up WRT a common (and normal) producer timeout error (since it also does not necessarily mean there's a problem):
Though it uses a fairly generic
_TRANSPORT
(-195
AKA "Broker transport failure") error code, which I think might be harder to safely capture (it seems more generic compared to some of the other error types).It might be safe to capture them all, as another somewhat related one I encountered when tweaking
connections.max.idle.ms
was:But I think more research should be done on this.