[ 
https://issues.apache.org/jira/browse/HADOOP-18351?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17683533#comment-17683533
 ] 

ASF GitHub Bot commented on HADOOP-18351:
-----------------------------------------

steveloughran commented on code in PR #5274:
URL: https://github.com/apache/hadoop/pull/5274#discussion_r1094943230


##########
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/impl/prefetch/CachingBlockManager.java:
##########
@@ -302,7 +302,13 @@ public void cancelPrefetches() {
 
   private void read(BufferData data) throws IOException {
     synchronized (data) {
-      readBlock(data, false, BufferData.State.BLANK);
+      try {
+        readBlock(data, false, BufferData.State.BLANK);
+      } catch(Exception e) {

Review Comment:
   add a space between catch and "(", and only catch IOException



##########
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/impl/prefetch/CachingBlockManager.java:
##########
@@ -302,7 +302,13 @@ public void cancelPrefetches() {
 
   private void read(BufferData data) throws IOException {
     synchronized (data) {
-      readBlock(data, false, BufferData.State.BLANK);
+      try {
+        readBlock(data, false, BufferData.State.BLANK);
+      } catch(Exception e) {
+        String message = String.format("error reading block %s", 
data.getBlockNumber());
+        LOG.error(message, e);

Review Comment:
   the string formatting can go into the LOG.error() just like the ones below





> S3A prefetching: Error logging during reads
> -------------------------------------------
>
>                 Key: HADOOP-18351
>                 URL: https://issues.apache.org/jira/browse/HADOOP-18351
>             Project: Hadoop Common
>          Issue Type: Sub-task
>    Affects Versions: 3.4.0
>            Reporter: Ahmar Suhail
>            Assignee: Ankit Saurabh
>            Priority: Minor
>              Labels: pull-request-available
>
> Look at how errors during read are logged, current implementation could flood 
> logs with stack traces on failures.
> proposed
>  * errors in prefetch only logged at info with error text but not stack
>  * full stack logged at debug
> but: we do want the most recent failure to be raised on the next read() on 
> the stream when there is no data in the cache.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-issues-h...@hadoop.apache.org

Reply via email to