Author: frm
Date: Mon Apr  8 14:05:42 2019
New Revision: 1857109

URL: http://svn.apache.org/viewvc?rev=1857109&view=rev
Log:
OAK-8202 - Print a warn message when RemoteBlobProcessor swallows an exception

Modified:
    
jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/standby/client/RemoteBlobProcessor.java

Modified: 
jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/standby/client/RemoteBlobProcessor.java
URL: 
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/standby/client/RemoteBlobProcessor.java?rev=1857109&r1=1857108&r2=1857109&view=diff
==============================================================================
--- 
jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/standby/client/RemoteBlobProcessor.java
 (original)
+++ 
jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/standby/client/RemoteBlobProcessor.java
 Mon Apr  8 14:05:42 2019
@@ -27,9 +27,13 @@ import java.io.InputStream;
 import org.apache.jackrabbit.oak.api.Blob;
 import org.apache.jackrabbit.oak.segment.SegmentBlob;
 import org.apache.jackrabbit.oak.spi.blob.BlobStore;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 class RemoteBlobProcessor implements BlobProcessor {
 
+    private static final Logger logger = 
LoggerFactory.getLogger(RemoteBlobProcessor.class);
+
     interface BlobDownloader {
 
         InputStream downloadBlob(String blobId) throws InterruptedException;
@@ -80,6 +84,7 @@ class RemoteBlobProcessor implements Blo
         try {
             reference = blob.getReference();
         } catch (Exception e) {
+            logger.warn("Unable to read a reference for blob {}", blobId, e);
             reference = null;
         }
 
@@ -98,6 +103,7 @@ class RemoteBlobProcessor implements Blo
         try {
             data = blobStore.getInputStream(blobId);
         } catch (Exception e) {
+            logger.warn("Unable to open a stream for blob {}, the blob will be 
downloaded", blobId, e);
             return true;
         }
 
@@ -108,6 +114,7 @@ class RemoteBlobProcessor implements Blo
         try {
             data.read();
         } catch (Exception e) {
+            logger.warn("Unable to read the content for blob {}, the blob will 
be downloaded", blobId, e);
             return true;
         } finally {
             closeQuietly(data);


Reply via email to