-
Notifications
You must be signed in to change notification settings - Fork 29.1k
[SPARK-47603][KUBERNETES][YARN] Resource managers: Migrate logWarn with variables to structured logging framework #45957
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
e2f42e2
8730a52
f6b39b7
4050517
4430785
a91bbb2
919f9f5
5021dca
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 |
|---|---|---|
|
|
@@ -24,7 +24,8 @@ import org.apache.spark.deploy.k8s._ | |
| import org.apache.spark.deploy.k8s.Config._ | ||
| import org.apache.spark.deploy.k8s.Constants._ | ||
| import org.apache.spark.deploy.k8s.submit._ | ||
| import org.apache.spark.internal.Logging | ||
| import org.apache.spark.internal.{Logging, MDC} | ||
| import org.apache.spark.internal.LogKey.{CONFIG, CONFIG2, CONFIG3, CONFIG4, CONFIG5} | ||
|
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. Although this looks |
||
| import org.apache.spark.internal.config.{PYSPARK_DRIVER_PYTHON, PYSPARK_PYTHON} | ||
| import org.apache.spark.launcher.SparkLauncher | ||
|
|
||
|
|
@@ -78,10 +79,11 @@ private[spark] class DriverCommandFeatureStep(conf: KubernetesDriverConf) | |
| private def configureForPython(pod: SparkPod, res: String): SparkPod = { | ||
| if (conf.get(PYSPARK_MAJOR_PYTHON_VERSION).isDefined) { | ||
| logWarning( | ||
| s"${PYSPARK_MAJOR_PYTHON_VERSION.key} was deprecated in Spark 3.1. " + | ||
| s"Please set '${PYSPARK_PYTHON.key}' and '${PYSPARK_DRIVER_PYTHON.key}' " + | ||
| s"configurations or $ENV_PYSPARK_PYTHON and $ENV_PYSPARK_DRIVER_PYTHON environment " + | ||
| "variables instead.") | ||
| log"${MDC(CONFIG, PYSPARK_MAJOR_PYTHON_VERSION.key)} was deprecated in Spark 3.1. " + | ||
| log"Please set '${MDC(CONFIG2, PYSPARK_PYTHON.key)}' and " + | ||
| log"'${MDC(CONFIG3, PYSPARK_DRIVER_PYTHON.key)}' " + | ||
| log"configurations or ${MDC(CONFIG4, ENV_PYSPARK_PYTHON)} and " + | ||
| log"${MDC(CONFIG5, ENV_PYSPARK_DRIVER_PYTHON)} environment variables instead.") | ||
| } | ||
|
|
||
| val pythonEnvs = { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -44,7 +44,7 @@ import org.apache.spark.deploy.history.HistoryServer | |
| import org.apache.spark.deploy.security.HadoopDelegationTokenManager | ||
| import org.apache.spark.deploy.yarn.config._ | ||
| import org.apache.spark.internal.{Logging, MDC} | ||
| import org.apache.spark.internal.LogKey.{EXIT_CODE, REMOTE_ADDRESS} | ||
| import org.apache.spark.internal.LogKey.{EXIT_CODE, FAILURES, RPC_ADDRESS} | ||
| import org.apache.spark.internal.config._ | ||
| import org.apache.spark.internal.config.UI._ | ||
| import org.apache.spark.metrics.{MetricsSystem, MetricsSystemInstances} | ||
|
|
@@ -597,7 +597,8 @@ private[spark] class ApplicationMaster( | |
| ApplicationMaster.EXIT_REPORTER_FAILURE, "Exception was thrown " + | ||
| s"$failureCount time(s) from Reporter thread.") | ||
| } else { | ||
| logWarning(s"Reporter thread fails $failureCount time(s) in a row.", e) | ||
| logWarning( | ||
| log"Reporter thread fails ${MDC(FAILURES, failureCount)} time(s) in a row.", e) | ||
| } | ||
| } | ||
| try { | ||
|
|
@@ -857,7 +858,7 @@ private[spark] class ApplicationMaster( | |
| finish(FinalApplicationStatus.SUCCEEDED, ApplicationMaster.EXIT_SUCCESS) | ||
| } else { | ||
| logError(log"Driver terminated with exit code ${MDC(EXIT_CODE, exitCode)}! " + | ||
| log"Shutting down. ${MDC(REMOTE_ADDRESS, remoteAddress)}") | ||
| log"Shutting down. ${MDC(RPC_ADDRESS, remoteAddress)}") | ||
|
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. This seems unrelated to this PR, but I found that the LogKey |
||
| finish(FinalApplicationStatus.FAILED, exitCode) | ||
| } | ||
| } else { | ||
|
|
||
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.
I found that the LogKey
REMOTE_ADDRESSandRPC_ADDRESShave the same meaning, so I removedREMOTE_ADDRESSfromLogKeyand only keptRPC_ADDRESS