attilapiros commented on a change in pull request #34319:
URL: https://github.com/apache/spark/pull/34319#discussion_r731602866
##########
File path:
resource-managers/kubernetes/core/src/main/scala/org/apache/spark/scheduler/cluster/k8s/ExecutorPodsAllocator.scala
##########
@@ -456,11 +456,11 @@ class ExecutorPodsAllocator(
private def isExecutorIdleTimedOut(state: ExecutorPodState, currentTime:
Long): Boolean = {
try {
- val startTime =
Instant.parse(state.pod.getStatus.getStartTime).toEpochMilli()
+ val startTime =
Instant.parse(state.pod.getMetadata.getCreationTimestamp).toEpochMilli()
currentTime - startTime > executorIdleTimeout
} catch {
- case _: Exception =>
- logDebug(s"Cannot get startTime of pod ${state.pod}")
+ case e: Exception =>
+ logError(s"Cannot get the createTime of the pod $state.pod", e)
Review comment:
Nit: createTime => creationTimestamp
Can you please update the PR description, too?
Do you have a some documentation of `creationTimestamp`, can you share a
link in the PR description?
It would be nice to see the guarantees we have regarding this.
##########
File path:
resource-managers/kubernetes/core/src/main/scala/org/apache/spark/scheduler/cluster/k8s/ExecutorPodsAllocator.scala
##########
@@ -456,11 +456,11 @@ class ExecutorPodsAllocator(
private def isExecutorIdleTimedOut(state: ExecutorPodState, currentTime:
Long): Boolean = {
try {
- val startTime =
Instant.parse(state.pod.getStatus.getStartTime).toEpochMilli()
+ val startTime =
Instant.parse(state.pod.getMetadata.getCreationTimestamp).toEpochMilli()
currentTime - startTime > executorIdleTimeout
} catch {
- case _: Exception =>
- logDebug(s"Cannot get startTime of pod ${state.pod}")
+ case e: Exception =>
+ logError(s"Cannot get the createTime of the pod $state.pod", e)
Review comment:
We should use {} in the string interpolation when the expression is not
a simple variable.
So instead of `$state.pod` please use `${state.pod}`.
https://docs.scala-lang.org/overviews/core/string-interpolation.html#the-s-string-interpolator
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]