You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by "steveloughran (via GitHub)" <gi...@apache.org> on 2023/02/02 18:57:06 UTC

[GitHub] [hadoop] steveloughran commented on a diff in pull request #5274: HADOOP-18351. Reduce excess logging of errors during S3A prefetching reads

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



-- 
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: common-issues-unsubscribe@hadoop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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