Skip to content

Commit

Permalink
Fix bug of enqueuing Computaitons in end stage.
Browse files Browse the repository at this point in the history
  • Loading branch information
renjiezh committed May 19, 2024
1 parent b5e261c commit 7c4d5fa
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ abstract class MillBase(
token,
"Failing computation due to too many failed ComputationStageAttempts.",
)
return
}

val wallDurationLogger = wallDurationLogger()
Expand Down Expand Up @@ -585,6 +586,10 @@ abstract class MillBase(

/** Enqueue a computation with a delay. */
private suspend fun enqueueComputation(token: ComputationToken) {
require(token.computationStage != endingStage) {
"Computation with ending stage cannot be enqueued."
}

// Exponential backoff
val baseDelay = minOf(600.0, (2.0.pow(token.attempt))).toInt()
// A random delay in the range of [baseDelay, 2*baseDelay]
Expand Down

0 comments on commit 7c4d5fa

Please sign in to comment.