Skip to content

Commit

Permalink
scalafmt
Browse files Browse the repository at this point in the history
  • Loading branch information
mcovarr committed Jan 30, 2025
1 parent 9c0f6d9 commit 7b35963
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ import com.google.cloud.batch.v1.BatchServiceSettings
import com.google.common.collect.ImmutableMap
import com.typesafe.scalalogging.StrictLogging
import cromwell.backend._
import cromwell.backend.google.batch.GcpBatchBackendLifecycleActorFactory.{
preemptionCountKey
}
import cromwell.backend.google.batch.GcpBatchBackendLifecycleActorFactory.preemptionCountKey
import cromwell.backend.google.batch.actors._
import cromwell.backend.google.batch.api.request.{BatchRequestExecutor, RequestHandler}
import cromwell.backend.google.batch.authentication.GcpBatchDockerCredentials
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,14 +178,15 @@ class GcpBatchAsyncBackendJobExecutionActor(override val standardParams: Standar

override def dockerImageUsed: Option[String] = Option(jobDockerImage)

override lazy val preemptible: Int = jobDescriptor.prefetchedKvStoreEntries.get(GcpBatchBackendLifecycleActorFactory.preemptionCountKey) match {
override lazy val preemptible: Int =
jobDescriptor.prefetchedKvStoreEntries.get(GcpBatchBackendLifecycleActorFactory.preemptionCountKey) match {
case Some(KvPair(_, v)) =>
Try(v.toInt) match {
case Success(m) => m
case Failure(_) => 0
case Failure(_) => 0
}
case _ => runtimeAttributes.preemptible
}
}

override def tryAbort(job: StandardAsyncJob): Unit =
abortJob(workflowId = workflowId,
Expand Down Expand Up @@ -1085,17 +1086,19 @@ class GcpBatchAsyncBackendJobExecutionActor(override val standardParams: Standar
def handleFailedRunStatus(runStatus: RunStatus.UnsuccessfulRunStatus): ExecutionHandle =
if (runStatus.exitCode == Some(GcpBatchExitCode.VMPreemption)) {
FailedRetryableExecutionHandle(
StandardException(
message = runStatus.prettyPrintedError,
jobTag = jobTag),
returnCode,
Option(Seq(KvPair(ScopedKey(workflowId, futureKvJobKey, GcpBatchBackendLifecycleActorFactory.preemptionCountKey), "0")))
StandardException(message = runStatus.prettyPrintedError, jobTag = jobTag),
returnCode,
Option(
Seq(
KvPair(ScopedKey(workflowId, futureKvJobKey, GcpBatchBackendLifecycleActorFactory.preemptionCountKey),
"0"
)
)
)
)
} else {
FailedNonRetryableExecutionHandle(
StandardException(
message = runStatus.prettyPrintedError,
jobTag = jobTag),
StandardException(message = runStatus.prettyPrintedError, jobTag = jobTag),
returnCode,
None
)
Expand Down

0 comments on commit 7b35963

Please sign in to comment.