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
KAFKA-7509: Reduce unnecessary and misleading “configuration supplied but not known” warning messages in Connect #5802
Conversation
…warning messages in Connect Change how configurations are passed to Kafka producer/consumer/adminClient to eliminate the `The configuration '{}' was supplied but isn't a known config` warning log messages for producer, consumer, and admin client.
Not sure how much of a concern it should be that we are using these |
@hachikuji, here is the PR that attempts to pass only the producer, consumer, and admin client configs to the producer, consumer, and admin client (respectively). As @cotedm mentioned above, this may be risky if any of these components might use configurations that are not in the ConfigDef. Do you have any thoughts about this approach? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rhauch Overall, I like the approach. AFAIK, all new configs get added to one of these ConfigDef's. With that assumption, I just had one comment about logging the configs that were not retained at debug level. I think it might be useful to have that in some rare cases. Thoughts?
connect/runtime/src/main/java/org/apache/kafka/connect/util/ConnectUtils.java
Show resolved
Hide resolved
…ty for subcomponent
@mageshn addressed your suggestion of a debug log message. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @rhauch. LGTM.
@ewencp or @hachikuji, any thoughts on this approach? |
Should we maybe consider adding this method directly to the AbstractConfig class? This could potentially be useful from other modules as well would logically fit there. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rhauch It seems like this shouldn't be necessary if ConfigDef for nested configs is used properly. It's likely somewhere we either aren't using it properly (passing along RecordingMaps from the AbstraactConfig) or we are doing logUnused() before we do nested configuration.
@ewencp that's a good point, and I probably have been overzealous in this fix. The worker does indeed only use select top-level properties when configuring the producer and then combines those with the prefixed / nested producer configs (see here). I guess the biggest culprit here are the three log-based stores, which pull in everything from the worker config and the properties with the So, these should probably all do something similar to what the worker does for its producer. This would work well for the producer and consumer, but it won't be enough for the admin client, which needs a subset of the producer and consumer configurations. But perhaps I don't understand what you mean by "doing logUnused() before we do nested configuration".
EDIT: actually, the Let me rework this PR to more correctly handle how the stores are collecting their producer and consumer properties, add the AdminClient method as mentioned above, and remove all of the other changes. (I may create a new PR since it's pretty much a completely different approach.) |
@rhauch For the internal topics, I don't think we can do something similar to what the worker does for its producer. AFAIK, the |
@mageshn, ok, good point. The worker's producer properties are passed to the source tasks, so that will not work. But I think @ewencp was right in that this isn't necessary for the And, @soenkeliebau was correct in pointing out that the current approach is losing all extensions for metric reporters and interceptors, sot that will require some changes. |
Okay, I am now to the point where I think this "hygiene" approach is completely flawed, and that instead the problem is that we're logging as warnings all "unused" properties in the producer, consumer, and the KafkaAdminClient. Let me back up. Based upon the discussion above, I modified my approach to attempt to retain all of the configuration properties that are known to the
That last bit is the problem: the properties to the clients' interceptors, serdes, metrics reporter, and partitions are all unprefixed, so it is impossible to know which properties are needed by any of the specified implementations. IOW, the properties passed to a producer, consumer, or admin client must be able to include any property that is needed by any of these custom components. And, because the Bottom line: I now posit that the only way to accurately eliminate these warnings is to remove the @ewencp, @hachikuji, @cmccabe: thoughts? |
Closing due to conclusion above. Will open a new PR with the proposed changes. |
Superseded by #5867 |
When running Connect, the logs contain quite a few warnings about:
This occurs when Connect creates producers, consumers, and admin clients, because the AbstractConfig is logging unused configuration properties upon construction. It's complicated by the fact that the
Producer
,Consumer
, andAdminClient
all create in their constructors private instances ofProducerConfig
,ConsumerConfig
, andAdminClientConfig
, respectively, and the unused properties are logged as warnings there. Because theAbstractConfig
instances are created by the client components, Connect is not able to call theignore(String key)
method to suppress those log warnings.Unfortunately, there are no arguments in the Producer, Consumer, or AdminClient public constructors to control whether the configs log these warning in their constructors. While that might be a possible change we want to make in the future, a simpler workaround is for Connect to be more hygienic and pass to the
Producer
,Consumer
, andAdminClient
constructors only those configuration properties that theProducerConfig
,ConsumerConfig
, andAdminClientConfig
configdefs know about.This PR makes this change for Connect.
If this approach is approved, we should consider how far back we want to port this change.
Committer Checklist (excluded from commit message)