Skip to content

Commit

Permalink
fix: Throw StorageException as TransientError from the mill (#1731)
Browse files Browse the repository at this point in the history
  • Loading branch information
renjiezh authored Aug 5, 2024
1 parent 7e27cf7 commit 7439d99
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,16 @@ private constructor(
content,
)
} catch (e: StorageException) {
throw PermanentErrorException("Error writing blob to storage.", e)
// Storage client is possible to raise non-retryable exceptions, which are actually
// retryable. To avoid to fail Computation in this case, mark all StorageExceptions as
// transient so the mill can start another attempt. This is only for LLv2 protocol because
// HMSS does not need to write intermediate result into storage.
//
// See github issue:
// https://github.com/world-federation-of-advertisers/cross-media-measurement/issues/1733
//
// TODO(@renjiez): Handle the exception case by case after the issue fixed.
throw TransientErrorException("Error writing blob to storage.", e)
}

val response: RecordOutputBlobPathResponse =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,9 @@ abstract class MillBase(
cause: Throwable? = null,
) {
val errorMessage: String = message ?: cause?.message.orEmpty()
val logMessageSupplier = { "${token.globalComputationId}@$millId: $errorMessage" }
val logMessageSupplier = {
"${token.globalComputationId}@$millId: Failing Computation. $errorMessage"
}
if (cause == null) {
logger.log(Level.SEVERE, logMessageSupplier)
} else {
Expand Down

0 comments on commit 7439d99

Please sign in to comment.