planga82 commented on a change in pull request #27026: [SPARK-29596][Web UI]
Task duration not updating for running tasks
URL: https://github.com/apache/spark/pull/27026#discussion_r379890163
##########
File path: core/src/main/scala/org/apache/spark/status/LiveEntity.scala
##########
@@ -175,10 +175,15 @@ private class LiveTask(
}
override protected def doUpdate(): Any = {
- val duration = if (info.finished) {
- info.duration
+ var duration: Long = 0
+ var executorRunTime: Long = 0
+
+ if (info.finished) {
Review comment:
vars are not very cool in scala... how about something like this?
```
val (duration, executorRunTime) = if (info.finished) {
(info.duration, metrics.executorRunTime)
} else {
val timeRunning =
info.timeRunning(lastUpdateTime.getOrElse(System.currentTimeMillis()))
(timeRunning, timeRunning)
}
```
----------------------------------------------------------------
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]