[jira] [Commented] (HDFS-13511) Provide specialized exception when block length cannot be obtained
[ https://issues.apache.org/jira/browse/HDFS-13511?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16492765#comment-16492765 ] genericqa commented on HDFS-13511: -- | (x) *{color:red}-1 overall{color}* | \\ \\ || Vote || Subsystem || Runtime || Comment || | {color:blue}0{color} | {color:blue} reexec {color} | {color:blue} 0m 36s{color} | {color:blue} Docker mode activated. {color} | || || || || {color:brown} Prechecks {color} || | {color:green}+1{color} | {color:green} @author {color} | {color:green} 0m 0s{color} | {color:green} The patch does not contain any @author tags. {color} | | {color:red}-1{color} | {color:red} test4tests {color} | {color:red} 0m 1s{color} | {color:red} The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch. {color} | || || || || {color:brown} trunk Compile Tests {color} || | {color:green}+1{color} | {color:green} mvninstall {color} | {color:green} 31m 4s{color} | {color:green} trunk passed {color} | | {color:green}+1{color} | {color:green} compile {color} | {color:green} 0m 49s{color} | {color:green} trunk passed {color} | | {color:green}+1{color} | {color:green} checkstyle {color} | {color:green} 0m 26s{color} | {color:green} trunk passed {color} | | {color:green}+1{color} | {color:green} mvnsite {color} | {color:green} 0m 50s{color} | {color:green} trunk passed {color} | | {color:green}+1{color} | {color:green} shadedclient {color} | {color:green} 12m 31s{color} | {color:green} branch has no errors when building and testing our client artifacts. {color} | | {color:green}+1{color} | {color:green} findbugs {color} | {color:green} 1m 46s{color} | {color:green} trunk passed {color} | | {color:green}+1{color} | {color:green} javadoc {color} | {color:green} 0m 33s{color} | {color:green} trunk passed {color} | || || || || {color:brown} Patch Compile Tests {color} || | {color:green}+1{color} | {color:green} mvninstall {color} | {color:green} 0m 51s{color} | {color:green} the patch passed {color} | | {color:green}+1{color} | {color:green} compile {color} | {color:green} 0m 47s{color} | {color:green} the patch passed {color} | | {color:green}+1{color} | {color:green} javac {color} | {color:green} 0m 47s{color} | {color:green} the patch passed {color} | | {color:green}+1{color} | {color:green} checkstyle {color} | {color:green} 0m 21s{color} | {color:green} the patch passed {color} | | {color:green}+1{color} | {color:green} mvnsite {color} | {color:green} 0m 49s{color} | {color:green} the patch passed {color} | | {color:green}+1{color} | {color:green} whitespace {color} | {color:green} 0m 0s{color} | {color:green} The patch has no whitespace issues. {color} | | {color:green}+1{color} | {color:green} shadedclient {color} | {color:green} 13m 1s{color} | {color:green} patch has no errors when building and testing our client artifacts. {color} | | {color:green}+1{color} | {color:green} findbugs {color} | {color:green} 2m 14s{color} | {color:green} the patch passed {color} | | {color:green}+1{color} | {color:green} javadoc {color} | {color:green} 0m 32s{color} | {color:green} the patch passed {color} | || || || || {color:brown} Other Tests {color} || | {color:green}+1{color} | {color:green} unit {color} | {color:green} 1m 46s{color} | {color:green} hadoop-hdfs-client in the patch passed. {color} | | {color:green}+1{color} | {color:green} asflicense {color} | {color:green} 0m 33s{color} | {color:green} The patch does not generate ASF License warnings. {color} | | {color:black}{color} | {color:black} {color} | {color:black} 70m 30s{color} | {color:black} {color} | \\ \\ || Subsystem || Report/Notes || | Docker | Client=17.05.0-ce Server=17.05.0-ce Image:yetus/hadoop:abb62dd | | JIRA Issue | HDFS-13511 | | JIRA Patch URL | https://issues.apache.org/jira/secure/attachment/12925433/HDFS-13511.001.patch | | Optional Tests | asflicense compile javac javadoc mvninstall mvnsite unit shadedclient findbugs checkstyle | | uname | Linux 2d93788cffd1 3.13.0-143-generic #192-Ubuntu SMP Tue Feb 27 10:45:36 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux | | Build tool | maven | | Personality | /testptch/patchprocess/precommit/personality/provided.sh | | git revision | trunk / 7c34366 | | maven | version: Apache Maven 3.3.9 | | Default Java | 1.8.0_162 | | findbugs | v3.1.0-RC1 | | Test Results | https://builds.apache.org/job/PreCommit-HDFS-Build/24316/testReport/ | | Max. process+thread count | 335 (vs. ulimit of 1) | | modules | C: hadoop-hdfs-project/hadoop-hdfs-client U: hadoop-hdfs-project/hadoop-hdfs-client | | Console output | https://builds.apache.org/job/PreCommit-HDFS-Build/24316/console | | Powered by | Apache Yetus 0.8.0-SNAPSHOT http://yetus.apache.org | This message was automatically generated. > Provide speciali
[jira] [Commented] (HDFS-13511) Provide specialized exception when block length cannot be obtained
[ https://issues.apache.org/jira/browse/HDFS-13511?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16493415#comment-16493415 ] Kitti Nanasi commented on HDFS-13511: - +1 Thanks for the patch, [~gabor.bota]! > Provide specialized exception when block length cannot be obtained > -- > > Key: HDFS-13511 > URL: https://issues.apache.org/jira/browse/HDFS-13511 > Project: Hadoop HDFS > Issue Type: Improvement >Reporter: Ted Yu >Assignee: Gabor Bota >Priority: Major > Attachments: HDFS-13511.001.patch > > > In downstream project, I saw the following code: > {code} > FSDataInputStream inputStream = hdfs.open(new Path(path)); > ... > if (options.getRecoverFailedOpen() && dfs != null && > e.getMessage().toLowerCase() > .startsWith("cannot obtain block length for")) { > {code} > The above tightly depends on the following in DFSInputStream#readBlockLength > {code} > throw new IOException("Cannot obtain block length for " + locatedblock); > {code} > The check based on string matching is brittle in production deployment. > After discussing with [~ste...@apache.org], better approach is to introduce > specialized IOException, e.g. CannotObtainBlockLengthException so that > downstream project doesn't have to rely on string matching. -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org
[jira] [Commented] (HDFS-13511) Provide specialized exception when block length cannot be obtained
[ https://issues.apache.org/jira/browse/HDFS-13511?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16496181#comment-16496181 ] Xiao Chen commented on HDFS-13511: -- Thanks [~yuzhih...@gmail.com] for creating the jira, and [~gabor.bota] for working on this. Some comments: - For downstream to use this, [compat guideline|http://hadoop.apache.org/docs/r3.0.0/hadoop-project-dist/hadoop-common/Compatibility.html] requires it to be public. Suggest to use Public + Unstable for the initial version - {{LocatedBlock}} is Private, let's not expose that via this exception. We can just construct a string message on the fly, and do not cache the LocatedBlock object. This way, we also don't have to worry about whether the {{LocatedBlock}} is mutable or not. See {{ReplicaNotFoundException}} for example. > Provide specialized exception when block length cannot be obtained > -- > > Key: HDFS-13511 > URL: https://issues.apache.org/jira/browse/HDFS-13511 > Project: Hadoop HDFS > Issue Type: Improvement >Reporter: Ted Yu >Assignee: Gabor Bota >Priority: Major > Attachments: HDFS-13511.001.patch > > > In downstream project, I saw the following code: > {code} > FSDataInputStream inputStream = hdfs.open(new Path(path)); > ... > if (options.getRecoverFailedOpen() && dfs != null && > e.getMessage().toLowerCase() > .startsWith("cannot obtain block length for")) { > {code} > The above tightly depends on the following in DFSInputStream#readBlockLength > {code} > throw new IOException("Cannot obtain block length for " + locatedblock); > {code} > The check based on string matching is brittle in production deployment. > After discussing with [~ste...@apache.org], better approach is to introduce > specialized IOException, e.g. CannotObtainBlockLengthException so that > downstream project doesn't have to rely on string matching. -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org
[jira] [Commented] (HDFS-13511) Provide specialized exception when block length cannot be obtained
[ https://issues.apache.org/jira/browse/HDFS-13511?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16500167#comment-16500167 ] Gabor Bota commented on HDFS-13511: --- Thanks for the review [~knanasi], [~xiaochen]. [~xiaochen] I've uploaded v2 patch with the changes you mentioned. > Provide specialized exception when block length cannot be obtained > -- > > Key: HDFS-13511 > URL: https://issues.apache.org/jira/browse/HDFS-13511 > Project: Hadoop HDFS > Issue Type: Improvement >Reporter: Ted Yu >Assignee: Gabor Bota >Priority: Major > Attachments: HDFS-13511.001.patch, HDFS-13511.002.patch > > > In downstream project, I saw the following code: > {code} > FSDataInputStream inputStream = hdfs.open(new Path(path)); > ... > if (options.getRecoverFailedOpen() && dfs != null && > e.getMessage().toLowerCase() > .startsWith("cannot obtain block length for")) { > {code} > The above tightly depends on the following in DFSInputStream#readBlockLength > {code} > throw new IOException("Cannot obtain block length for " + locatedblock); > {code} > The check based on string matching is brittle in production deployment. > After discussing with [~ste...@apache.org], better approach is to introduce > specialized IOException, e.g. CannotObtainBlockLengthException so that > downstream project doesn't have to rely on string matching. -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org
[jira] [Commented] (HDFS-13511) Provide specialized exception when block length cannot be obtained
[ https://issues.apache.org/jira/browse/HDFS-13511?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16500257#comment-16500257 ] genericqa commented on HDFS-13511: -- | (x) *{color:red}-1 overall{color}* | \\ \\ || Vote || Subsystem || Runtime || Comment || | {color:blue}0{color} | {color:blue} reexec {color} | {color:blue} 0m 38s{color} | {color:blue} Docker mode activated. {color} | || || || || {color:brown} Prechecks {color} || | {color:green}+1{color} | {color:green} @author {color} | {color:green} 0m 0s{color} | {color:green} The patch does not contain any @author tags. {color} | | {color:red}-1{color} | {color:red} test4tests {color} | {color:red} 0m 0s{color} | {color:red} The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch. {color} | || || || || {color:brown} trunk Compile Tests {color} || | {color:green}+1{color} | {color:green} mvninstall {color} | {color:green} 28m 0s{color} | {color:green} trunk passed {color} | | {color:green}+1{color} | {color:green} compile {color} | {color:green} 0m 43s{color} | {color:green} trunk passed {color} | | {color:green}+1{color} | {color:green} checkstyle {color} | {color:green} 0m 22s{color} | {color:green} trunk passed {color} | | {color:green}+1{color} | {color:green} mvnsite {color} | {color:green} 0m 44s{color} | {color:green} trunk passed {color} | | {color:green}+1{color} | {color:green} shadedclient {color} | {color:green} 12m 6s{color} | {color:green} branch has no errors when building and testing our client artifacts. {color} | | {color:green}+1{color} | {color:green} findbugs {color} | {color:green} 1m 54s{color} | {color:green} trunk passed {color} | | {color:green}+1{color} | {color:green} javadoc {color} | {color:green} 0m 34s{color} | {color:green} trunk passed {color} | || || || || {color:brown} Patch Compile Tests {color} || | {color:green}+1{color} | {color:green} mvninstall {color} | {color:green} 1m 2s{color} | {color:green} the patch passed {color} | | {color:green}+1{color} | {color:green} compile {color} | {color:green} 0m 51s{color} | {color:green} the patch passed {color} | | {color:green}+1{color} | {color:green} javac {color} | {color:green} 0m 51s{color} | {color:green} the patch passed {color} | | {color:green}+1{color} | {color:green} checkstyle {color} | {color:green} 0m 23s{color} | {color:green} the patch passed {color} | | {color:green}+1{color} | {color:green} mvnsite {color} | {color:green} 0m 49s{color} | {color:green} the patch passed {color} | | {color:green}+1{color} | {color:green} whitespace {color} | {color:green} 0m 0s{color} | {color:green} The patch has no whitespace issues. {color} | | {color:green}+1{color} | {color:green} shadedclient {color} | {color:green} 13m 15s{color} | {color:green} patch has no errors when building and testing our client artifacts. {color} | | {color:green}+1{color} | {color:green} findbugs {color} | {color:green} 2m 3s{color} | {color:green} the patch passed {color} | | {color:green}+1{color} | {color:green} javadoc {color} | {color:green} 0m 31s{color} | {color:green} the patch passed {color} | || || || || {color:brown} Other Tests {color} || | {color:green}+1{color} | {color:green} unit {color} | {color:green} 1m 43s{color} | {color:green} hadoop-hdfs-client in the patch passed. {color} | | {color:green}+1{color} | {color:green} asflicense {color} | {color:green} 0m 32s{color} | {color:green} The patch does not generate ASF License warnings. {color} | | {color:black}{color} | {color:black} {color} | {color:black} 67m 16s{color} | {color:black} {color} | \\ \\ || Subsystem || Report/Notes || | Docker | Client=17.05.0-ce Server=17.05.0-ce Image:yetus/hadoop:abb62dd | | JIRA Issue | HDFS-13511 | | JIRA Patch URL | https://issues.apache.org/jira/secure/attachment/12926369/HDFS-13511.002.patch | | Optional Tests | asflicense compile javac javadoc mvninstall mvnsite unit shadedclient findbugs checkstyle | | uname | Linux d833281fbe52 3.13.0-143-generic #192-Ubuntu SMP Tue Feb 27 10:45:36 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux | | Build tool | maven | | Personality | /testptch/patchprocess/precommit/personality/provided.sh | | git revision | trunk / 9efb4b7 | | maven | version: Apache Maven 3.3.9 | | Default Java | 1.8.0_162 | | findbugs | v3.1.0-RC1 | | Test Results | https://builds.apache.org/job/PreCommit-HDFS-Build/24373/testReport/ | | Max. process+thread count | 290 (vs. ulimit of 1) | | modules | C: hadoop-hdfs-project/hadoop-hdfs-client U: hadoop-hdfs-project/hadoop-hdfs-client | | Console output | https://builds.apache.org/job/PreCommit-HDFS-Build/24373/console | | Powered by | Apache Yetus 0.8.0-SNAPSHOT http://yetus.apache.org | This message was automatically generated. > Provide special
[jira] [Commented] (HDFS-13511) Provide specialized exception when block length cannot be obtained
[ https://issues.apache.org/jira/browse/HDFS-13511?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16500546#comment-16500546 ] Xiao Chen commented on HDFS-13511: -- Thanks Gabor for revving. +1 pending: - {code} Constructs an {@code CannotObtainBlockLengthException} with the specified detail message. {code} Should this be with the specified {{LocatedBlock}} that failed to obtain block length? - {{This exception is thrown when the the length of a LocatedBlock instance can not be obtained.}} Double 'the' in the message. > Provide specialized exception when block length cannot be obtained > -- > > Key: HDFS-13511 > URL: https://issues.apache.org/jira/browse/HDFS-13511 > Project: Hadoop HDFS > Issue Type: Improvement >Reporter: Ted Yu >Assignee: Gabor Bota >Priority: Major > Attachments: HDFS-13511.001.patch, HDFS-13511.002.patch > > > In downstream project, I saw the following code: > {code} > FSDataInputStream inputStream = hdfs.open(new Path(path)); > ... > if (options.getRecoverFailedOpen() && dfs != null && > e.getMessage().toLowerCase() > .startsWith("cannot obtain block length for")) { > {code} > The above tightly depends on the following in DFSInputStream#readBlockLength > {code} > throw new IOException("Cannot obtain block length for " + locatedblock); > {code} > The check based on string matching is brittle in production deployment. > After discussing with [~ste...@apache.org], better approach is to introduce > specialized IOException, e.g. CannotObtainBlockLengthException so that > downstream project doesn't have to rely on string matching. -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org
[jira] [Commented] (HDFS-13511) Provide specialized exception when block length cannot be obtained
[ https://issues.apache.org/jira/browse/HDFS-13511?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16500693#comment-16500693 ] Gabor Bota commented on HDFS-13511: --- Thanks [~xiaochen] for the review, I've uploaded patch v003 with the fix. > Provide specialized exception when block length cannot be obtained > -- > > Key: HDFS-13511 > URL: https://issues.apache.org/jira/browse/HDFS-13511 > Project: Hadoop HDFS > Issue Type: Improvement >Reporter: Ted Yu >Assignee: Gabor Bota >Priority: Major > Attachments: HDFS-13511.001.patch, HDFS-13511.002.patch, > HDFS-13511.003.patch > > > In downstream project, I saw the following code: > {code} > FSDataInputStream inputStream = hdfs.open(new Path(path)); > ... > if (options.getRecoverFailedOpen() && dfs != null && > e.getMessage().toLowerCase() > .startsWith("cannot obtain block length for")) { > {code} > The above tightly depends on the following in DFSInputStream#readBlockLength > {code} > throw new IOException("Cannot obtain block length for " + locatedblock); > {code} > The check based on string matching is brittle in production deployment. > After discussing with [~ste...@apache.org], better approach is to introduce > specialized IOException, e.g. CannotObtainBlockLengthException so that > downstream project doesn't have to rely on string matching. -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org
[jira] [Commented] (HDFS-13511) Provide specialized exception when block length cannot be obtained
[ https://issues.apache.org/jira/browse/HDFS-13511?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16500759#comment-16500759 ] genericqa commented on HDFS-13511: -- | (x) *{color:red}-1 overall{color}* | \\ \\ || Vote || Subsystem || Runtime || Comment || | {color:blue}0{color} | {color:blue} reexec {color} | {color:blue} 0m 23s{color} | {color:blue} Docker mode activated. {color} | || || || || {color:brown} Prechecks {color} || | {color:green}+1{color} | {color:green} @author {color} | {color:green} 0m 0s{color} | {color:green} The patch does not contain any @author tags. {color} | | {color:red}-1{color} | {color:red} test4tests {color} | {color:red} 0m 0s{color} | {color:red} The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch. {color} | || || || || {color:brown} trunk Compile Tests {color} || | {color:green}+1{color} | {color:green} mvninstall {color} | {color:green} 23m 34s{color} | {color:green} trunk passed {color} | | {color:green}+1{color} | {color:green} compile {color} | {color:green} 0m 32s{color} | {color:green} trunk passed {color} | | {color:green}+1{color} | {color:green} checkstyle {color} | {color:green} 0m 16s{color} | {color:green} trunk passed {color} | | {color:green}+1{color} | {color:green} mvnsite {color} | {color:green} 0m 34s{color} | {color:green} trunk passed {color} | | {color:green}+1{color} | {color:green} shadedclient {color} | {color:green} 9m 22s{color} | {color:green} branch has no errors when building and testing our client artifacts. {color} | | {color:green}+1{color} | {color:green} findbugs {color} | {color:green} 1m 25s{color} | {color:green} trunk passed {color} | | {color:green}+1{color} | {color:green} javadoc {color} | {color:green} 0m 22s{color} | {color:green} trunk passed {color} | || || || || {color:brown} Patch Compile Tests {color} || | {color:green}+1{color} | {color:green} mvninstall {color} | {color:green} 0m 37s{color} | {color:green} the patch passed {color} | | {color:green}+1{color} | {color:green} compile {color} | {color:green} 0m 33s{color} | {color:green} the patch passed {color} | | {color:green}+1{color} | {color:green} javac {color} | {color:green} 0m 33s{color} | {color:green} the patch passed {color} | | {color:green}+1{color} | {color:green} checkstyle {color} | {color:green} 0m 16s{color} | {color:green} the patch passed {color} | | {color:green}+1{color} | {color:green} mvnsite {color} | {color:green} 0m 35s{color} | {color:green} the patch passed {color} | | {color:green}+1{color} | {color:green} whitespace {color} | {color:green} 0m 0s{color} | {color:green} The patch has no whitespace issues. {color} | | {color:green}+1{color} | {color:green} shadedclient {color} | {color:green} 9m 33s{color} | {color:green} patch has no errors when building and testing our client artifacts. {color} | | {color:green}+1{color} | {color:green} findbugs {color} | {color:green} 1m 26s{color} | {color:green} the patch passed {color} | | {color:green}+1{color} | {color:green} javadoc {color} | {color:green} 0m 22s{color} | {color:green} the patch passed {color} | || || || || {color:brown} Other Tests {color} || | {color:green}+1{color} | {color:green} unit {color} | {color:green} 1m 23s{color} | {color:green} hadoop-hdfs-client in the patch passed. {color} | | {color:green}+1{color} | {color:green} asflicense {color} | {color:green} 0m 18s{color} | {color:green} The patch does not generate ASF License warnings. {color} | | {color:black}{color} | {color:black} {color} | {color:black} 52m 1s{color} | {color:black} {color} | \\ \\ || Subsystem || Report/Notes || | Docker | Client=17.05.0-ce Server=17.05.0-ce Image:yetus/hadoop:abb62dd | | JIRA Issue | HDFS-13511 | | JIRA Patch URL | https://issues.apache.org/jira/secure/attachment/12926432/HDFS-13511.003.patch | | Optional Tests | asflicense compile javac javadoc mvninstall mvnsite unit shadedclient findbugs checkstyle | | uname | Linux 5bf3646b5572 4.4.0-64-generic #85-Ubuntu SMP Mon Feb 20 11:50:30 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux | | Build tool | maven | | Personality | /testptch/patchprocess/precommit/personality/provided.sh | | git revision | trunk / e2c172d | | maven | version: Apache Maven 3.3.9 | | Default Java | 1.8.0_162 | | findbugs | v3.1.0-RC1 | | Test Results | https://builds.apache.org/job/PreCommit-HDFS-Build/24375/testReport/ | | Max. process+thread count | 407 (vs. ulimit of 1) | | modules | C: hadoop-hdfs-project/hadoop-hdfs-client U: hadoop-hdfs-project/hadoop-hdfs-client | | Console output | https://builds.apache.org/job/PreCommit-HDFS-Build/24375/console | | Powered by | Apache Yetus 0.8.0-SNAPSHOT http://yetus.apache.org | This message was automatically generated. > Provide specialize
[jira] [Commented] (HDFS-13511) Provide specialized exception when block length cannot be obtained
[ https://issues.apache.org/jira/browse/HDFS-13511?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16501274#comment-16501274 ] Xiao Chen commented on HDFS-13511: -- +1 on patch 3. Will commit EOB Tuesday if no further comments from others. > Provide specialized exception when block length cannot be obtained > -- > > Key: HDFS-13511 > URL: https://issues.apache.org/jira/browse/HDFS-13511 > Project: Hadoop HDFS > Issue Type: Improvement >Reporter: Ted Yu >Assignee: Gabor Bota >Priority: Major > Attachments: HDFS-13511.001.patch, HDFS-13511.002.patch, > HDFS-13511.003.patch > > > In downstream project, I saw the following code: > {code} > FSDataInputStream inputStream = hdfs.open(new Path(path)); > ... > if (options.getRecoverFailedOpen() && dfs != null && > e.getMessage().toLowerCase() > .startsWith("cannot obtain block length for")) { > {code} > The above tightly depends on the following in DFSInputStream#readBlockLength > {code} > throw new IOException("Cannot obtain block length for " + locatedblock); > {code} > The check based on string matching is brittle in production deployment. > After discussing with [~ste...@apache.org], better approach is to introduce > specialized IOException, e.g. CannotObtainBlockLengthException so that > downstream project doesn't have to rely on string matching. -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org
[jira] [Commented] (HDFS-13511) Provide specialized exception when block length cannot be obtained
[ https://issues.apache.org/jira/browse/HDFS-13511?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16502815#comment-16502815 ] Hudson commented on HDFS-13511: --- FAILURE: Integrated in Jenkins build Hadoop-trunk-Commit #14370 (See [https://builds.apache.org/job/Hadoop-trunk-Commit/14370/]) HDFS-13511. Provide specialized exception when block length cannot be (xiao: rev 774c1f199e11d886d0c0a1069325f0284da35deb) * (add) hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/CannotObtainBlockLengthException.java * (edit) hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/DFSInputStream.java > Provide specialized exception when block length cannot be obtained > -- > > Key: HDFS-13511 > URL: https://issues.apache.org/jira/browse/HDFS-13511 > Project: Hadoop HDFS > Issue Type: Improvement >Reporter: Ted Yu >Assignee: Gabor Bota >Priority: Major > Fix For: 3.2.0 > > Attachments: HDFS-13511.001.patch, HDFS-13511.002.patch, > HDFS-13511.003.patch > > > In downstream project, I saw the following code: > {code} > FSDataInputStream inputStream = hdfs.open(new Path(path)); > ... > if (options.getRecoverFailedOpen() && dfs != null && > e.getMessage().toLowerCase() > .startsWith("cannot obtain block length for")) { > {code} > The above tightly depends on the following in DFSInputStream#readBlockLength > {code} > throw new IOException("Cannot obtain block length for " + locatedblock); > {code} > The check based on string matching is brittle in production deployment. > After discussing with [~ste...@apache.org], better approach is to introduce > specialized IOException, e.g. CannotObtainBlockLengthException so that > downstream project doesn't have to rely on string matching. -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org
[jira] [Commented] (HDFS-13511) Provide specialized exception when block length cannot be obtained
[ https://issues.apache.org/jira/browse/HDFS-13511?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16509677#comment-16509677 ] Ted Yu commented on HDFS-13511: --- Can this be merged into 3.1 branch ? thanks > Provide specialized exception when block length cannot be obtained > -- > > Key: HDFS-13511 > URL: https://issues.apache.org/jira/browse/HDFS-13511 > Project: Hadoop HDFS > Issue Type: Improvement >Reporter: Ted Yu >Assignee: Gabor Bota >Priority: Major > Fix For: 3.2.0 > > Attachments: HDFS-13511.001.patch, HDFS-13511.002.patch, > HDFS-13511.003.patch > > > In downstream project, I saw the following code: > {code} > FSDataInputStream inputStream = hdfs.open(new Path(path)); > ... > if (options.getRecoverFailedOpen() && dfs != null && > e.getMessage().toLowerCase() > .startsWith("cannot obtain block length for")) { > {code} > The above tightly depends on the following in DFSInputStream#readBlockLength > {code} > throw new IOException("Cannot obtain block length for " + locatedblock); > {code} > The check based on string matching is brittle in production deployment. > After discussing with [~ste...@apache.org], better approach is to introduce > specialized IOException, e.g. CannotObtainBlockLengthException so that > downstream project doesn't have to rely on string matching. -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org
[jira] [Commented] (HDFS-13511) Provide specialized exception when block length cannot be obtained
[ https://issues.apache.org/jira/browse/HDFS-13511?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16509988#comment-16509988 ] Xiao Chen commented on HDFS-13511: -- Just backported to branch-3.1. > Provide specialized exception when block length cannot be obtained > -- > > Key: HDFS-13511 > URL: https://issues.apache.org/jira/browse/HDFS-13511 > Project: Hadoop HDFS > Issue Type: Improvement >Reporter: Ted Yu >Assignee: Gabor Bota >Priority: Major > Fix For: 3.2.0, 3.1.1 > > Attachments: HDFS-13511.001.patch, HDFS-13511.002.patch, > HDFS-13511.003.patch > > > In downstream project, I saw the following code: > {code} > FSDataInputStream inputStream = hdfs.open(new Path(path)); > ... > if (options.getRecoverFailedOpen() && dfs != null && > e.getMessage().toLowerCase() > .startsWith("cannot obtain block length for")) { > {code} > The above tightly depends on the following in DFSInputStream#readBlockLength > {code} > throw new IOException("Cannot obtain block length for " + locatedblock); > {code} > The check based on string matching is brittle in production deployment. > After discussing with [~ste...@apache.org], better approach is to introduce > specialized IOException, e.g. CannotObtainBlockLengthException so that > downstream project doesn't have to rely on string matching. -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org
[jira] [Commented] (HDFS-13511) Provide specialized exception when block length cannot be obtained
[ https://issues.apache.org/jira/browse/HDFS-13511?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=1645#comment-1645 ] Wei-Chiu Chuang commented on HDFS-13511: +1 for a specialized exception class. There are a number of places in Hadoop code where a general IOException is thrown and downstream or caller has to do string match. Like for example what I mentioned in HDFS-11711. > Provide specialized exception when block length cannot be obtained > -- > > Key: HDFS-13511 > URL: https://issues.apache.org/jira/browse/HDFS-13511 > Project: Hadoop HDFS > Issue Type: Improvement >Reporter: Ted Yu >Priority: Major > > In downstream project, I saw the following code: > {code} > FSDataInputStream inputStream = hdfs.open(new Path(path)); > ... > if (options.getRecoverFailedOpen() && dfs != null && > e.getMessage().toLowerCase() > .startsWith("cannot obtain block length for")) { > {code} > The above tightly depends on the following in DFSInputStream#readBlockLength > {code} > throw new IOException("Cannot obtain block length for " + locatedblock); > {code} > The check based on string matching is brittle in production deployment. > After discussing with [~ste...@apache.org], better approach is to introduce > specialized IOException, e.g. CannotObtainBlockLengthException so that > downstream project doesn't have to rely on string matching. -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org