Skip to content

Conversation

@viirya
Copy link
Member

@viirya viirya commented Dec 20, 2021

What changes were proposed in this pull request?

This is a followup of SPARK-6305. Some places in build files (maven and sbt) which remove log4j properties files should be updated. Some tests programmingly write log4j properties should be updated to log4j 2 syntax too.

Why are the changes needed?

To clean up build files and migrate some tests to log4j2 syntax.

Does this PR introduce any user-facing change?

No

How was this patch tested?

Pass all tests.

@SparkQA
Copy link

SparkQA commented Dec 20, 2021

Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/50871/

@SparkQA
Copy link

SparkQA commented Dec 20, 2021

Kubernetes integration test status failure
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/50871/

@SparkQA

This comment has been minimized.

Copy link
Member

@dongjoon-hyun dongjoon-hyun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1, LGTM (if CI passed).

@viirya
Copy link
Member Author

viirya commented Dec 20, 2021

Thanks @dongjoon-hyun . Wait for CI.

@SparkQA
Copy link

SparkQA commented Dec 20, 2021

Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/50877/

@SparkQA
Copy link

SparkQA commented Dec 20, 2021

Kubernetes integration test status failure
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/50877/

@attilapiros
Copy link
Contributor

I think there is a related error in the kubernetes integration tests:

  <testcase
  name="Verify logging configuration is picked from the provided SPARK_CONF_DIR/log4j.properties" classname="org.apache.spark.deploy.k8s.integrationtest.KubernetesSuite" time="204.286">
    <failure
    message="The code passed to eventually never returned normally. Attempted 180 times over 3.000611025833334 minutes. Last failure message: &quot;++ id -u&amp;#010;+ myuid=185&amp;#010;++ id -g&amp;#010;+ mygid=0&amp;#01
0;+ set +e&amp;#010;++ getent passwd 185&amp;#010;+ uidentry=&amp;#010;+ set -e&amp;#010;+ '[' -z '' ']'&amp;#010;+ ...

It is around here:

val loggingConfigFileName = "log-config-test-log4j.properties"
val loggingConfURL: URL = this.getClass.getClassLoader.getResource(loggingConfigFileName)
assert(loggingConfURL != null, "Logging configuration file not available.")
val content = Source.createBufferedSource(loggingConfURL.openStream()).getLines().mkString("\n")
val logConfFilePath = s"${sparkHomeDir.toFile}/conf/log4j.properties"
try {
Files.write(new File(logConfFilePath).toPath, content.getBytes)
sparkAppConf.set("spark.driver.extraJavaOptions", "-Dlog4j.debug")
sparkAppConf.set("spark.executor.extraJavaOptions", "-Dlog4j.debug")
sparkAppConf.set("spark.kubernetes.executor.deleteOnTermination", "false")
val log4jExpectedLog =
s"log4j: Reading configuration from URL file:/opt/spark/conf/log4j.properties"

Switching on DEBUG for log4j initialization does not trigger the logging of the expected output.

@SparkQA
Copy link

SparkQA commented Dec 20, 2021

Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/50881/

@SparkQA
Copy link

SparkQA commented Dec 20, 2021

Test build #146402 has finished for PR 34959 at commit cec77a4.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@viirya
Copy link
Member Author

viirya commented Dec 20, 2021

Hmm, I changed the log4j properties file for the k8s integration test. But seems the test still cannot get the log4j 2 configuration file. Not sure why now. I will merge this first and keep looking at the k8s integration test issue.

@SparkQA
Copy link

SparkQA commented Dec 20, 2021

Kubernetes integration test status failure
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/50881/

@SparkQA
Copy link

SparkQA commented Dec 20, 2021

Test build #146406 has finished for PR 34959 at commit 6ae05e1.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@viirya
Copy link
Member Author

viirya commented Dec 20, 2021

Jenkins tests were passed. Thanks for reviewing. Merging to master.

@viirya viirya closed this in 9f6062a Dec 20, 2021
@LuciferYang
Copy link
Contributor

@viirya It seems that test failure still exists in hive-thriftserver module:

https://amplab.cs.berkeley.edu/jenkins/job/spark-master-test-maven-hadoop-3.2/3527/consoleFull

@viirya
Copy link
Member Author

viirya commented Dec 21, 2021

Which one you mean? I don't see failed test in test results.

@LuciferYang
Copy link
Contributor

=========================================
End HiveThriftServer2Suite failure output
=========================================
       
22:53:44.821 INFO org.apache.spark.sql.hive.thriftserver.HiveThriftBinaryServerSuite: HiveThriftServer2 stopped
22:53:44.827 WARN org.apache.spark.sql.hive.thriftserver.HiveThriftBinaryServerSuite: 

===== POSSIBLE THREAD LEAK IN SUITE o.a.s.sql.hive.thriftserver.HiveThriftBinaryServerSuite, threads: Thread-13 (daemon=true), Thread-12 (daemon=true) =====

*** RUN ABORTED ***
  java.util.concurrent.TimeoutException: Futures timed out after [3 minutes]
  at scala.concurrent.impl.Promise$DefaultPromise.ready(Promise.scala:259)
  at scala.concurrent.impl.Promise$DefaultPromise.result(Promise.scala:263)
  at org.apache.spark.util.ThreadUtils$.awaitResult(ThreadUtils.scala:293)
  at org.apache.spark.sql.hive.thriftserver.HiveThriftServer2TestBase.startThriftServer(HiveThriftServer2Suites.scala:1344)
  at org.apache.spark.sql.hive.thriftserver.HiveThriftServer2TestBase.$anonfun$beforeAll$4(HiveThriftServer2Suites.scala:1397)
  at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23)
  at scala.util.Try$.apply(Try.scala:213)
  at org.apache.spark.sql.hive.thriftserver.HiveThriftServer2TestBase.$anonfun$beforeAll$3(HiveThriftServer2Suites.scala:1396)
  at scala.util.Failure.orElse(Try.scala:224)
  at org.apache.spark.sql.hive.thriftserver.HiveThriftServer2TestBase.$anonfun$beforeAll$2(HiveThriftServer2Suites.scala:1394)

@viirya
Copy link
Member Author

viirya commented Dec 21, 2021

I will try to reproduce it locally.

@LuciferYang
Copy link
Contributor

And there are some error log as follows:

Discovery starting.
2021-12-20 22:41:21,477 ScalaTest-main ERROR Filters contains invalid attributes "onMatch", "onMismatch"
2021-12-20 22:41:21,492 ScalaTest-main ERROR Filters contains invalid attributes "onMatch", "onMismatch"
Discovery completed in 1 second, 557 milliseconds.
Run starting. Expected test count is: 551

It seems that there is some thing wrong with log4j2 configuration.

@viirya
Copy link
Member Author

viirya commented Dec 21, 2021

The log4j error I have seen locally, but it doesn't affect SBT test. Not sure if it is related.

@LuciferYang
Copy link
Contributor

The log4j error I have seen locally, but it doesn't affect SBT test. Not sure if it is related.

ok

@viirya
Copy link
Member Author

viirya commented Dec 21, 2021

Do you see other issues? Seems other tests are all passed on maven, right?

@LuciferYang
Copy link
Contributor

Do you see other issues? Seems other tests are all passed on maven, right?

It seems so, only hive-thriftserver module test fail now

|appender.console.layout.type = PatternLayout
|appender.console.layout.pattern = %d{yy/MM/dd HH:mm:ss} %p %c{1}: %m%n
""".stripMargin,
new File(s"$tempLog4jConf/log4j.properties"),
Copy link
Contributor

@LuciferYang LuciferYang Dec 21, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change new File(s"$tempLog4jConf/log4j.properties") to new File(s"$tempLog4jConf/log4j2.properties"), then HiveThriftBinaryServerSuite no longer hang

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

However, it seems that all logs are printed to the console, which is different from the previous behavior

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SBT cannot reproduce it. But we should use log4j2.properties.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I corrected this together in #34965.

sumwale pushed a commit to TIBCOSoftware/snappy-spark that referenced this pull request Feb 9, 2022
This is a followup of SPARK-6305. Some places in build files (maven and sbt) which remove log4j properties files should be updated. Some tests programmingly write log4j properties should be updated to log4j 2 syntax too.

To clean up build files and migrate some tests to log4j2 syntax.

No

Pass all tests.

Closes apache#34959 from viirya/log4j2_followup.

Authored-by: Liang-Chi Hsieh <[email protected]>
Signed-off-by: Liang-Chi Hsieh <[email protected]>
kazuyukitanimura pushed a commit to kazuyukitanimura/spark that referenced this pull request Aug 10, 2022
### What changes were proposed in this pull request?

This is a followup of SPARK-6305. Some places in build files (maven and sbt) which remove log4j properties files should be updated. Some tests programmingly write log4j properties should be updated to log4j 2 syntax too.

### Why are the changes needed?

To clean up build files and migrate some tests to log4j2 syntax.

### Does this PR introduce _any_ user-facing change?

No

### How was this patch tested?

Pass all tests.

Closes apache#34959 from viirya/log4j2_followup.

Authored-by: Liang-Chi Hsieh <[email protected]>
Signed-off-by: Liang-Chi Hsieh <[email protected]>
asiunov pushed a commit to ascend-io/spark that referenced this pull request Aug 25, 2022
### What changes were proposed in this pull request?

This is a followup of SPARK-6305. Some places in build files (maven and sbt) which remove log4j properties files should be updated. Some tests programmingly write log4j properties should be updated to log4j 2 syntax too.

### Why are the changes needed?

To clean up build files and migrate some tests to log4j2 syntax.

### Does this PR introduce _any_ user-facing change?

No

### How was this patch tested?

Pass all tests.

Closes apache#34959 from viirya/log4j2_followup.

Authored-by: Liang-Chi Hsieh <[email protected]>
Signed-off-by: Liang-Chi Hsieh <[email protected]>
(cherry picked from commit 9f6062a)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants