-
Notifications
You must be signed in to change notification settings - Fork 15.4k
MINOR: Log formatting for exceptions during configuration related operations #10843
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -295,7 +295,7 @@ class DynamicBrokerConfig(private val kafkaConfig: KafkaConfig) extends Logging | |
| dynamicBrokerConfigs ++= props.asScala | ||
| updateCurrentConfig() | ||
| } catch { | ||
| case e: Exception => error(s"Per-broker configs of $brokerId could not be applied: $persistentProps", e) | ||
| case e: Exception => error(s"Per-broker configs of $brokerId could not be applied: ${persistentProps.keys()}", e) | ||
| } | ||
| } | ||
|
|
||
|
|
@@ -306,7 +306,7 @@ class DynamicBrokerConfig(private val kafkaConfig: KafkaConfig) extends Logging | |
| dynamicDefaultConfigs ++= props.asScala | ||
| updateCurrentConfig() | ||
| } catch { | ||
| case e: Exception => error(s"Cluster default configs could not be applied: $persistentProps", e) | ||
| case e: Exception => error(s"Cluster default configs could not be applied: ${persistentProps.keys()}", e) | ||
| } | ||
| } | ||
|
|
||
|
|
@@ -469,7 +469,7 @@ class DynamicBrokerConfig(private val kafkaConfig: KafkaConfig) extends Logging | |
| } | ||
| invalidProps.keys.foreach(props.remove) | ||
| val configSource = if (perBrokerConfig) "broker" else "default cluster" | ||
| error(s"Dynamic $configSource config contains invalid values: $invalidProps, these configs will be ignored", e) | ||
| error(s"Dynamic $configSource config contains invalid values in: ${invalidProps.keys}, these configs will be ignored", e) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why should we log only Also same questions to above 2 changes. Thanks.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi @showuon, the concern here is Props are key value pairs passed in from user. It's possible user puts sensitive or secret content in "value" that we should not log onto disk. There is no single Config here to tell which key may contain sensitive or secrets, so current solution is for invalid input, we only print keys to give user hints and user can refer their "origins" to figure out the reason.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. SGTM! Thanks. |
||
| } | ||
| } | ||
|
|
||
|
|
@@ -555,7 +555,8 @@ class DynamicBrokerConfig(private val kafkaConfig: KafkaConfig) extends Logging | |
| } catch { | ||
| case e: Exception => | ||
| if (!validateOnly) | ||
| error(s"Failed to update broker configuration with configs : ${newConfig.originalsFromThisConfig}", e) | ||
| error(s"Failed to update broker configuration with configs : " + | ||
| s"${ConfigUtils.configMapToRedactedString(newConfig.originalsFromThisConfig, KafkaConfig.configDef)}", e) | ||
| throw new ConfigException("Invalid dynamic configuration", e) | ||
| } | ||
| } | ||
|
|
||
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.
Nice fix!