Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -456,11 +456,11 @@ class ExecutorPodsAllocator(

private def isExecutorIdleTimedOut(state: ExecutorPodState, currentTime: Long): Boolean = {
try {
val startTime = Instant.parse(state.pod.getStatus.getStartTime).toEpochMilli()
currentTime - startTime > executorIdleTimeout
val creationTime = Instant.parse(state.pod.getMetadata.getCreationTimestamp).toEpochMilli()
currentTime - creationTime > executorIdleTimeout
} catch {
case _: Exception =>
logDebug(s"Cannot get startTime of pod ${state.pod}")
case e: Exception =>
logError(s"Cannot get the creationTimestamp of the pod: ${state.pod}", e)
true
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,11 @@ object ExecutorLifecycleTestUtils {

def pendingExecutor(executorId: Long, rpId: Int = DEFAULT_RESOURCE_PROFILE_ID): Pod = {
new PodBuilder(podWithAttachedContainerForId(executorId, rpId))
.editOrNewMetadata()
.withCreationTimestamp(Instant.now.toString)
.endMetadata()
.editOrNewStatus()
.withPhase("pending")
.withStartTime(Instant.now.toString)
.endStatus()
.build()
}
Expand Down