Skip to content

Commit

Permalink
Log bob deserialization exception for snapshot blobs
Browse files Browse the repository at this point in the history
  • Loading branch information
ajothomas committed Oct 9, 2024
1 parent 56c6267 commit 5188fa3
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,13 @@ public CompletableFuture<SnapshotIndex> getSnapshotIndex(String blobId, Metadata
return FutureUtil.executeAsyncWithRetries(opName, () -> {
ByteArrayOutputStream indexBlobStream = new ByteArrayOutputStream(); // no need to close ByteArrayOutputStream
return blobStoreManager.get(blobId, indexBlobStream, metadata, getDeleted).toCompletableFuture()
.thenApplyAsync(f -> snapshotIndexSerde.fromBytes(indexBlobStream.toByteArray()), executor);
.thenApplyAsync(f -> {
try {
return snapshotIndexSerde.fromBytes(indexBlobStream.toByteArray());
} catch (Exception e) {
throw new SamzaException(String.format("Unable to deserialize SnapshotIndex bytes for blob ID: %s", blobId), e);
}
}, executor);
}, isCauseNonRetriable(), executor, retryPolicyConfig);
}

Expand Down

0 comments on commit 5188fa3

Please sign in to comment.