Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make qob stages fail eagerly #14745

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
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
12 changes: 9 additions & 3 deletions hail/src/main/scala/is/hail/backend/service/ServiceBackend.scala
Original file line number Diff line number Diff line change
Expand Up @@ -270,8 +270,8 @@ class ServiceBackend(

stageCount += 1
implicit val formats: Formats = DefaultFormats
val batchState = (batch \ "state").extract[String]
if (batchState == "failed") {
val jobGroupState = (batch \ "state").extract[String]
if (jobGroupState == "error") {
throw new HailBatchFailure(s"Update $updateId for batch $batchId failed")
}

Expand Down Expand Up @@ -313,7 +313,13 @@ class ServiceBackend(

log.info(s"parallelizeAndComputeWithIndex: $token: reading results")
val startTime = System.nanoTime()
val r @ (error, results) = runAllKeepFirstError(new CancellingExecutorService(executor)) {
val r @ (error, results) = runAll[Option, Array[Byte]](executor) {
/* A missing file means the job was cancelled because another job failed. Assumes that if any
* job was cancelled, then at least one job failed. We want to ignore the missing file
* exceptions and return one of the actual failure exceptions. */
case (opt, _: FileNotFoundException) => opt
case (opt, e) => opt.orElse(Some(e))
}(None) {
(partIdxs, parts.indices).zipped.map { (partIdx, jobIndex) =>
(() => readResult(root, jobIndex), partIdx)
}
Expand Down