wypoon commented on a change in pull request #23767: [SPARK-26329][CORE] Faster
polling of executor memory metrics.
URL: https://github.com/apache/spark/pull/23767#discussion_r269298021
##########
File path: core/src/test/scala/org/apache/spark/executor/ExecutorSuite.scala
##########
@@ -392,6 +457,17 @@ class ExecutorSuite extends SparkFunSuite
uncaughtExceptionHandler = mockUncaughtExceptionHandler)
// the task will be launched in a dedicated worker thread
executor.launchTask(mockBackend, taskDescription)
+ if (poll) {
+ // Ensure that the executor's metricsPoller is polled at least once so
that values are
+ // recorded for the task metrics.
+ // When the task fails, peak values for these metrics get sent in the
TaskFailedReason.
+ val executorClass = classOf[Executor]
+ val metricsPollerField =
+
executorClass.getDeclaredField("org$apache$spark$executor$Executor$$metricsPoller")
+ metricsPollerField.setAccessible(true)
+ val metricsPoller =
metricsPollerField.get(executor).asInstanceOf[ExecutorMetricsPoller]
Review comment:
Ok, I can do that instead, since I'm the one who introduced metricsPoller! I
guess in other cases where folks have used reflection for something like this,
maybe they didn't want to alter the existing class under test.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]