xinyuiscool commented on code in PR #1711:
URL: https://github.com/apache/samza/pull/1711#discussion_r1795867796


##########
samza-core/src/main/java/org/apache/samza/storage/blobstore/util/BlobStoreUtil.java:
##########
@@ -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 -> 
snapshotIndexSerde.fromBytes(indexBlobStream.toByteArray()), executor)
+          .handle((snapshotIndex, ex) -> {
+            if (ex != null) {
+              throw new SamzaException(String.format("Unable to deserialize 
SnapshotIndex bytes for blob ID: %s", blobId), ex);

Review Comment:
   Seems we might get other kinds of exceptions here, e.g. GET exceptions, so 
change the log message to be "Unable to get SnapshotIndex ..." ?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to