[jira] [Commented] (HDFS-13730) BlockReaderRemote.sendReadResult throws NPE
[ https://issues.apache.org/jira/browse/HDFS-13730?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16866195#comment-16866195 ] Hudson commented on HDFS-13730: --- SUCCESS: Integrated in Jenkins build Hadoop-trunk-Commit #16766 (See [https://builds.apache.org/job/Hadoop-trunk-Commit/16766/]) HDFS-13730. BlockReaderRemote.sendReadResult throws NPE. Contributed by (weichiu: rev 62ad9885ea8c75c134de43a3a925c76b253658e1) * (edit) hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/net/BasicInetPeer.java * (edit) hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/net/NioInetPeer.java > BlockReaderRemote.sendReadResult throws NPE > --- > > Key: HDFS-13730 > URL: https://issues.apache.org/jira/browse/HDFS-13730 > Project: Hadoop HDFS > Issue Type: Bug > Components: hdfs-client >Affects Versions: 3.0.0 > Environment: Hadoop 3.0.0, HBase 2.0.0 + HBASE-20403. > (hbase-site.xml) hbase.rs.prefetchblocksonopen=true >Reporter: Wei-Chiu Chuang >Assignee: Yuanbo Liu >Priority: Major > Fix For: 2.10.0, 3.0.4, 3.3.0, 2.8.6, 3.2.1, 2.9.3, 3.1.3 > > Attachments: HDFS-13730.001.patch > > > Found the following exception thrown in a HBase RegionServer log (Hadoop > 3.0.0 + HBase 2.0.0. The hbase prefetch bug HBASE-20403 was fixed on this > cluster, but I am not sure if that's related at all): > {noformat} > 2018-07-11 11:10:44,462 WARN > org.apache.hadoop.hbase.io.hfile.HFileReaderImpl: Stream moved/closed or > prefetch > cancelled?path=hdfs://ns1/hbase/data/default/IntegrationTestBigLinkedList_20180711003954/449fa9bf5a7483295493258b5af50abc/meta/e9de0683f8a9413a94183c752bea0ca5, > offset=216505135, > end=2309991906 > java.lang.NullPointerException > at > org.apache.hadoop.hdfs.net.NioInetPeer.getRemoteAddressString(NioInetPeer.java:99) > at > org.apache.hadoop.hdfs.net.EncryptedPeer.getRemoteAddressString(EncryptedPeer.java:105) > at > org.apache.hadoop.hdfs.client.impl.BlockReaderRemote.sendReadResult(BlockReaderRemote.java:330) > at > org.apache.hadoop.hdfs.client.impl.BlockReaderRemote.readNextPacket(BlockReaderRemote.java:233) > at > org.apache.hadoop.hdfs.client.impl.BlockReaderRemote.read(BlockReaderRemote.java:165) > at > org.apache.hadoop.hdfs.DFSInputStream.actualGetFromOneDataNode(DFSInputStream.java:1050) > at > org.apache.hadoop.hdfs.DFSInputStream.fetchBlockByteRange(DFSInputStream.java:992) > at org.apache.hadoop.hdfs.DFSInputStream.pread(DFSInputStream.java:1348) > at org.apache.hadoop.hdfs.DFSInputStream.read(DFSInputStream.java:1312) > at org.apache.hadoop.crypto.CryptoInputStream.read(CryptoInputStream.java:331) > at org.apache.hadoop.fs.FSDataInputStream.read(FSDataInputStream.java:92) > at > org.apache.hadoop.hbase.io.hfile.HFileBlock.positionalReadWithExtra(HFileBlock.java:805) > at > org.apache.hadoop.hbase.io.hfile.HFileBlock$FSReaderImpl.readAtOffset(HFileBlock.java:1565) > at > org.apache.hadoop.hbase.io.hfile.HFileBlock$FSReaderImpl.readBlockDataInternal(HFileBlock.java:1769) > at > org.apache.hadoop.hbase.io.hfile.HFileBlock$FSReaderImpl.readBlockData(HFileBlock.java:1594) > at > org.apache.hadoop.hbase.io.hfile.HFileReaderImpl.readBlock(HFileReaderImpl.java:1488) > at > org.apache.hadoop.hbase.io.hfile.HFileReaderImpl$1.run(HFileReaderImpl.java:278) > at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) > at java.util.concurrent.FutureTask.run(FutureTask.java:266) > at > java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) > at > java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) > at > java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) > at > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) > at java.lang.Thread.run(Thread.java:748){noformat} > The relevant Hadoop code: > {code:java|title=BlockReaderRemote#sendReadResult} > void sendReadResult(Status statusCode) { > assert !sentStatusCode : "already sent status code to " + peer; > try { > writeReadResult(peer.getOutputStream(), statusCode); > sentStatusCode = true; > } catch (IOException e) { > // It's ok not to be able to send this. But something is probably wrong. > LOG.info("Could not send read status (" + statusCode + ") to datanode " + > peer.getRemoteAddressString() + ": " + e.getMessage()); > } > } > {code} > So the NPE was thrown within a exception handler. A possible explanation > could be that the socket was closed so client couldn't write, and > Socket#getRemoteSocketAddress() returns null when the socket is closed. > Suggest check for nullity and return an empty string in > NioInet
[jira] [Commented] (HDFS-13730) BlockReaderRemote.sendReadResult throws NPE
[ https://issues.apache.org/jira/browse/HDFS-13730?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16866190#comment-16866190 ] Wei-Chiu Chuang commented on HDFS-13730: +1 patch still applies. Committing v001 patch. > BlockReaderRemote.sendReadResult throws NPE > --- > > Key: HDFS-13730 > URL: https://issues.apache.org/jira/browse/HDFS-13730 > Project: Hadoop HDFS > Issue Type: Bug > Components: hdfs-client >Affects Versions: 3.0.0 > Environment: Hadoop 3.0.0, HBase 2.0.0 + HBASE-20403. > (hbase-site.xml) hbase.rs.prefetchblocksonopen=true >Reporter: Wei-Chiu Chuang >Assignee: Yuanbo Liu >Priority: Major > Attachments: HDFS-13730.001.patch > > > Found the following exception thrown in a HBase RegionServer log (Hadoop > 3.0.0 + HBase 2.0.0. The hbase prefetch bug HBASE-20403 was fixed on this > cluster, but I am not sure if that's related at all): > {noformat} > 2018-07-11 11:10:44,462 WARN > org.apache.hadoop.hbase.io.hfile.HFileReaderImpl: Stream moved/closed or > prefetch > cancelled?path=hdfs://ns1/hbase/data/default/IntegrationTestBigLinkedList_20180711003954/449fa9bf5a7483295493258b5af50abc/meta/e9de0683f8a9413a94183c752bea0ca5, > offset=216505135, > end=2309991906 > java.lang.NullPointerException > at > org.apache.hadoop.hdfs.net.NioInetPeer.getRemoteAddressString(NioInetPeer.java:99) > at > org.apache.hadoop.hdfs.net.EncryptedPeer.getRemoteAddressString(EncryptedPeer.java:105) > at > org.apache.hadoop.hdfs.client.impl.BlockReaderRemote.sendReadResult(BlockReaderRemote.java:330) > at > org.apache.hadoop.hdfs.client.impl.BlockReaderRemote.readNextPacket(BlockReaderRemote.java:233) > at > org.apache.hadoop.hdfs.client.impl.BlockReaderRemote.read(BlockReaderRemote.java:165) > at > org.apache.hadoop.hdfs.DFSInputStream.actualGetFromOneDataNode(DFSInputStream.java:1050) > at > org.apache.hadoop.hdfs.DFSInputStream.fetchBlockByteRange(DFSInputStream.java:992) > at org.apache.hadoop.hdfs.DFSInputStream.pread(DFSInputStream.java:1348) > at org.apache.hadoop.hdfs.DFSInputStream.read(DFSInputStream.java:1312) > at org.apache.hadoop.crypto.CryptoInputStream.read(CryptoInputStream.java:331) > at org.apache.hadoop.fs.FSDataInputStream.read(FSDataInputStream.java:92) > at > org.apache.hadoop.hbase.io.hfile.HFileBlock.positionalReadWithExtra(HFileBlock.java:805) > at > org.apache.hadoop.hbase.io.hfile.HFileBlock$FSReaderImpl.readAtOffset(HFileBlock.java:1565) > at > org.apache.hadoop.hbase.io.hfile.HFileBlock$FSReaderImpl.readBlockDataInternal(HFileBlock.java:1769) > at > org.apache.hadoop.hbase.io.hfile.HFileBlock$FSReaderImpl.readBlockData(HFileBlock.java:1594) > at > org.apache.hadoop.hbase.io.hfile.HFileReaderImpl.readBlock(HFileReaderImpl.java:1488) > at > org.apache.hadoop.hbase.io.hfile.HFileReaderImpl$1.run(HFileReaderImpl.java:278) > at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) > at java.util.concurrent.FutureTask.run(FutureTask.java:266) > at > java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) > at > java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) > at > java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) > at > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) > at java.lang.Thread.run(Thread.java:748){noformat} > The relevant Hadoop code: > {code:java|title=BlockReaderRemote#sendReadResult} > void sendReadResult(Status statusCode) { > assert !sentStatusCode : "already sent status code to " + peer; > try { > writeReadResult(peer.getOutputStream(), statusCode); > sentStatusCode = true; > } catch (IOException e) { > // It's ok not to be able to send this. But something is probably wrong. > LOG.info("Could not send read status (" + statusCode + ") to datanode " + > peer.getRemoteAddressString() + ": " + e.getMessage()); > } > } > {code} > So the NPE was thrown within a exception handler. A possible explanation > could be that the socket was closed so client couldn't write, and > Socket#getRemoteSocketAddress() returns null when the socket is closed. > Suggest check for nullity and return an empty string in > NioInetPeer.getRemoteAddressString. -- 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-13730) BlockReaderRemote.sendReadResult throws NPE
[ https://issues.apache.org/jira/browse/HDFS-13730?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16544470#comment-16544470 ] genericqa commented on HDFS-13730: -- | (x) *{color:red}-1 overall{color}* | \\ \\ || Vote || Subsystem || Runtime || Comment || | {color:blue}0{color} | {color:blue} reexec {color} | {color:blue} 0m 34s{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} 27m 9s{color} | {color:green} trunk passed {color} | | {color:green}+1{color} | {color:green} compile {color} | {color:green} 0m 39s{color} | {color:green} trunk passed {color} | | {color:green}+1{color} | {color:green} checkstyle {color} | {color:green} 0m 14s{color} | {color:green} trunk passed {color} | | {color:green}+1{color} | {color:green} mvnsite {color} | {color:green} 0m 42s{color} | {color:green} trunk passed {color} | | {color:green}+1{color} | {color:green} shadedclient {color} | {color:green} 11m 56s{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 34s{color} | {color:green} trunk passed {color} | | {color:green}+1{color} | {color:green} javadoc {color} | {color:green} 0m 27s{color} | {color:green} trunk passed {color} | || || || || {color:brown} Patch Compile Tests {color} || | {color:green}+1{color} | {color:green} mvninstall {color} | {color:green} 0m 40s{color} | {color:green} the patch passed {color} | | {color:green}+1{color} | {color:green} compile {color} | {color:green} 0m 34s{color} | {color:green} the patch passed {color} | | {color:green}+1{color} | {color:green} javac {color} | {color:green} 0m 34s{color} | {color:green} the patch passed {color} | | {color:green}+1{color} | {color:green} checkstyle {color} | {color:green} 0m 9s{color} | {color:green} the patch passed {color} | | {color:green}+1{color} | {color:green} mvnsite {color} | {color:green} 0m 37s{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} 12m 16s{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 39s{color} | {color:green} the patch passed {color} | | {color:green}+1{color} | {color:green} javadoc {color} | {color:green} 0m 24s{color} | {color:green} the patch passed {color} | || || || || {color:brown} Other Tests {color} || | {color:green}+1{color} | {color:green} unit {color} | {color:green} 1m 32s{color} | {color:green} hadoop-hdfs-client in the patch passed. {color} | | {color:green}+1{color} | {color:green} asflicense {color} | {color:green} 0m 23s{color} | {color:green} The patch does not generate ASF License warnings. {color} | | {color:black}{color} | {color:black} {color} | {color:black} 62m 13s{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-13730 | | JIRA Patch URL | https://issues.apache.org/jira/secure/attachment/12931323/HDFS-13730.001.patch | | Optional Tests | asflicense compile javac javadoc mvninstall mvnsite unit shadedclient findbugs checkstyle | | uname | Linux 7fd1d4cc2973 3.13.0-153-generic #203-Ubuntu SMP Thu Jun 14 08:52:28 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux | | Build tool | maven | | Personality | /testptch/patchprocess/precommit/personality/provided.sh | | git revision | trunk / 103f2ee | | maven | version: Apache Maven 3.3.9 | | Default Java | 1.8.0_171 | | findbugs | v3.1.0-RC1 | | Test Results | https://builds.apache.org/job/PreCommit-HDFS-Build/24593/testReport/ | | Max. process+thread count | 303 (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/24593/console | | Powered by | Apache Yetus 0.8.0-SNAPSHOT http://yetus.apache.org | This message was automatically generated. > BlockReaderRemo
[jira] [Commented] (HDFS-13730) BlockReaderRemote.sendReadResult throws NPE
[ https://issues.apache.org/jira/browse/HDFS-13730?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16544450#comment-16544450 ] Yuanbo Liu commented on HDFS-13730: --- Good idea. I'll update my patch according to your comments. > BlockReaderRemote.sendReadResult throws NPE > --- > > Key: HDFS-13730 > URL: https://issues.apache.org/jira/browse/HDFS-13730 > Project: Hadoop HDFS > Issue Type: Bug > Components: hdfs-client >Affects Versions: 3.0.0 > Environment: Hadoop 3.0.0, HBase 2.0.0 + HBASE-20403. > (hbase-site.xml) hbase.rs.prefetchblocksonopen=true >Reporter: Wei-Chiu Chuang >Assignee: Yuanbo Liu >Priority: Major > Attachments: HDFS-13730.001.patch > > > Found the following exception thrown in a HBase RegionServer log (Hadoop > 3.0.0 + HBase 2.0.0. The hbase prefetch bug HBASE-20403 was fixed on this > cluster, but I am not sure if that's related at all): > {noformat} > 2018-07-11 11:10:44,462 WARN > org.apache.hadoop.hbase.io.hfile.HFileReaderImpl: Stream moved/closed or > prefetch > cancelled?path=hdfs://ns1/hbase/data/default/IntegrationTestBigLinkedList_20180711003954/449fa9bf5a7483295493258b5af50abc/meta/e9de0683f8a9413a94183c752bea0ca5, > offset=216505135, > end=2309991906 > java.lang.NullPointerException > at > org.apache.hadoop.hdfs.net.NioInetPeer.getRemoteAddressString(NioInetPeer.java:99) > at > org.apache.hadoop.hdfs.net.EncryptedPeer.getRemoteAddressString(EncryptedPeer.java:105) > at > org.apache.hadoop.hdfs.client.impl.BlockReaderRemote.sendReadResult(BlockReaderRemote.java:330) > at > org.apache.hadoop.hdfs.client.impl.BlockReaderRemote.readNextPacket(BlockReaderRemote.java:233) > at > org.apache.hadoop.hdfs.client.impl.BlockReaderRemote.read(BlockReaderRemote.java:165) > at > org.apache.hadoop.hdfs.DFSInputStream.actualGetFromOneDataNode(DFSInputStream.java:1050) > at > org.apache.hadoop.hdfs.DFSInputStream.fetchBlockByteRange(DFSInputStream.java:992) > at org.apache.hadoop.hdfs.DFSInputStream.pread(DFSInputStream.java:1348) > at org.apache.hadoop.hdfs.DFSInputStream.read(DFSInputStream.java:1312) > at org.apache.hadoop.crypto.CryptoInputStream.read(CryptoInputStream.java:331) > at org.apache.hadoop.fs.FSDataInputStream.read(FSDataInputStream.java:92) > at > org.apache.hadoop.hbase.io.hfile.HFileBlock.positionalReadWithExtra(HFileBlock.java:805) > at > org.apache.hadoop.hbase.io.hfile.HFileBlock$FSReaderImpl.readAtOffset(HFileBlock.java:1565) > at > org.apache.hadoop.hbase.io.hfile.HFileBlock$FSReaderImpl.readBlockDataInternal(HFileBlock.java:1769) > at > org.apache.hadoop.hbase.io.hfile.HFileBlock$FSReaderImpl.readBlockData(HFileBlock.java:1594) > at > org.apache.hadoop.hbase.io.hfile.HFileReaderImpl.readBlock(HFileReaderImpl.java:1488) > at > org.apache.hadoop.hbase.io.hfile.HFileReaderImpl$1.run(HFileReaderImpl.java:278) > at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) > at java.util.concurrent.FutureTask.run(FutureTask.java:266) > at > java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) > at > java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) > at > java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) > at > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) > at java.lang.Thread.run(Thread.java:748){noformat} > The relevant Hadoop code: > {code:java|title=BlockReaderRemote#sendReadResult} > void sendReadResult(Status statusCode) { > assert !sentStatusCode : "already sent status code to " + peer; > try { > writeReadResult(peer.getOutputStream(), statusCode); > sentStatusCode = true; > } catch (IOException e) { > // It's ok not to be able to send this. But something is probably wrong. > LOG.info("Could not send read status (" + statusCode + ") to datanode " + > peer.getRemoteAddressString() + ": " + e.getMessage()); > } > } > {code} > So the NPE was thrown within a exception handler. A possible explanation > could be that the socket was closed so client couldn't write, and > Socket#getRemoteSocketAddress() returns null when the socket is closed. > Suggest check for nullity and return an empty string in > NioInetPeer.getRemoteAddressString. -- 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-13730) BlockReaderRemote.sendReadResult throws NPE
[ https://issues.apache.org/jira/browse/HDFS-13730?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16543506#comment-16543506 ] Wei-Chiu Chuang commented on HDFS-13730: Thanks [~yuanbo] your suggestion makes sense to me. Searching the Hadoop again, I can see getRemoteAddressString() get used in an exception catch block within {{DataXceiver#replaceBlock()}}. Now when I think about this again, the exception handler within {{DataXceiver#replaceBlock()}} and {{BlockReaderRemote.sendReadResult}}, and it would print like "Error writing reply back to null". While that's fine, could we make it more easier to understand, by checking that getRemoteAddressString() returns null and say "Error writing reply back, socket closed?" It would be even better if we could cache the remote address string before the exception, so the even if the socket is closed we could still find the remote address? > BlockReaderRemote.sendReadResult throws NPE > --- > > Key: HDFS-13730 > URL: https://issues.apache.org/jira/browse/HDFS-13730 > Project: Hadoop HDFS > Issue Type: Bug > Components: hdfs-client >Affects Versions: 3.0.0 > Environment: Hadoop 3.0.0, HBase 2.0.0 + HBASE-20403. > (hbase-site.xml) hbase.rs.prefetchblocksonopen=true >Reporter: Wei-Chiu Chuang >Assignee: Yuanbo Liu >Priority: Major > Attachments: HDFS-13730.001.patch > > > Found the following exception thrown in a HBase RegionServer log (Hadoop > 3.0.0 + HBase 2.0.0. The hbase prefetch bug HBASE-20403 was fixed on this > cluster, but I am not sure if that's related at all): > {noformat} > 2018-07-11 11:10:44,462 WARN > org.apache.hadoop.hbase.io.hfile.HFileReaderImpl: Stream moved/closed or > prefetch > cancelled?path=hdfs://ns1/hbase/data/default/IntegrationTestBigLinkedList_20180711003954/449fa9bf5a7483295493258b5af50abc/meta/e9de0683f8a9413a94183c752bea0ca5, > offset=216505135, > end=2309991906 > java.lang.NullPointerException > at > org.apache.hadoop.hdfs.net.NioInetPeer.getRemoteAddressString(NioInetPeer.java:99) > at > org.apache.hadoop.hdfs.net.EncryptedPeer.getRemoteAddressString(EncryptedPeer.java:105) > at > org.apache.hadoop.hdfs.client.impl.BlockReaderRemote.sendReadResult(BlockReaderRemote.java:330) > at > org.apache.hadoop.hdfs.client.impl.BlockReaderRemote.readNextPacket(BlockReaderRemote.java:233) > at > org.apache.hadoop.hdfs.client.impl.BlockReaderRemote.read(BlockReaderRemote.java:165) > at > org.apache.hadoop.hdfs.DFSInputStream.actualGetFromOneDataNode(DFSInputStream.java:1050) > at > org.apache.hadoop.hdfs.DFSInputStream.fetchBlockByteRange(DFSInputStream.java:992) > at org.apache.hadoop.hdfs.DFSInputStream.pread(DFSInputStream.java:1348) > at org.apache.hadoop.hdfs.DFSInputStream.read(DFSInputStream.java:1312) > at org.apache.hadoop.crypto.CryptoInputStream.read(CryptoInputStream.java:331) > at org.apache.hadoop.fs.FSDataInputStream.read(FSDataInputStream.java:92) > at > org.apache.hadoop.hbase.io.hfile.HFileBlock.positionalReadWithExtra(HFileBlock.java:805) > at > org.apache.hadoop.hbase.io.hfile.HFileBlock$FSReaderImpl.readAtOffset(HFileBlock.java:1565) > at > org.apache.hadoop.hbase.io.hfile.HFileBlock$FSReaderImpl.readBlockDataInternal(HFileBlock.java:1769) > at > org.apache.hadoop.hbase.io.hfile.HFileBlock$FSReaderImpl.readBlockData(HFileBlock.java:1594) > at > org.apache.hadoop.hbase.io.hfile.HFileReaderImpl.readBlock(HFileReaderImpl.java:1488) > at > org.apache.hadoop.hbase.io.hfile.HFileReaderImpl$1.run(HFileReaderImpl.java:278) > at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) > at java.util.concurrent.FutureTask.run(FutureTask.java:266) > at > java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) > at > java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) > at > java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) > at > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) > at java.lang.Thread.run(Thread.java:748){noformat} > The relevant Hadoop code: > {code:java|title=BlockReaderRemote#sendReadResult} > void sendReadResult(Status statusCode) { > assert !sentStatusCode : "already sent status code to " + peer; > try { > writeReadResult(peer.getOutputStream(), statusCode); > sentStatusCode = true; > } catch (IOException e) { > // It's ok not to be able to send this. But something is probably wrong. > LOG.info("Could not send read status (" + statusCode + ") to datanode " + > peer.getRemoteAddressString() + ": " + e.getMessage()); > } > } > {code} > So the NPE was thrown within a exception handler. A possible explanation > could be
[jira] [Commented] (HDFS-13730) BlockReaderRemote.sendReadResult throws NPE
[ https://issues.apache.org/jira/browse/HDFS-13730?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16541624#comment-16541624 ] Yuanbo Liu commented on HDFS-13730: --- [~jojochuang] I'd suggested to return null instead of "" to keep consistent with socket.getRemoteAddress() > BlockReaderRemote.sendReadResult throws NPE > --- > > Key: HDFS-13730 > URL: https://issues.apache.org/jira/browse/HDFS-13730 > Project: Hadoop HDFS > Issue Type: Bug > Components: hdfs-client >Affects Versions: 3.0.0 > Environment: Hadoop 3.0.0, HBase 2.0.0 + HBASE-20403. > (hbase-site.xml) hbase.rs.prefetchblocksonopen=true >Reporter: Wei-Chiu Chuang >Assignee: Yuanbo Liu >Priority: Major > Attachments: HDFS-13730.001.patch > > > Found the following exception thrown in a HBase RegionServer log (Hadoop > 3.0.0 + HBase 2.0.0. The hbase prefetch bug HBASE-20403 was fixed on this > cluster, but I am not sure if that's related at all): > {noformat} > 2018-07-11 11:10:44,462 WARN > org.apache.hadoop.hbase.io.hfile.HFileReaderImpl: Stream moved/closed or > prefetch > cancelled?path=hdfs://ns1/hbase/data/default/IntegrationTestBigLinkedList_20180711003954/449fa9bf5a7483295493258b5af50abc/meta/e9de0683f8a9413a94183c752bea0ca5, > offset=216505135, > end=2309991906 > java.lang.NullPointerException > at > org.apache.hadoop.hdfs.net.NioInetPeer.getRemoteAddressString(NioInetPeer.java:99) > at > org.apache.hadoop.hdfs.net.EncryptedPeer.getRemoteAddressString(EncryptedPeer.java:105) > at > org.apache.hadoop.hdfs.client.impl.BlockReaderRemote.sendReadResult(BlockReaderRemote.java:330) > at > org.apache.hadoop.hdfs.client.impl.BlockReaderRemote.readNextPacket(BlockReaderRemote.java:233) > at > org.apache.hadoop.hdfs.client.impl.BlockReaderRemote.read(BlockReaderRemote.java:165) > at > org.apache.hadoop.hdfs.DFSInputStream.actualGetFromOneDataNode(DFSInputStream.java:1050) > at > org.apache.hadoop.hdfs.DFSInputStream.fetchBlockByteRange(DFSInputStream.java:992) > at org.apache.hadoop.hdfs.DFSInputStream.pread(DFSInputStream.java:1348) > at org.apache.hadoop.hdfs.DFSInputStream.read(DFSInputStream.java:1312) > at org.apache.hadoop.crypto.CryptoInputStream.read(CryptoInputStream.java:331) > at org.apache.hadoop.fs.FSDataInputStream.read(FSDataInputStream.java:92) > at > org.apache.hadoop.hbase.io.hfile.HFileBlock.positionalReadWithExtra(HFileBlock.java:805) > at > org.apache.hadoop.hbase.io.hfile.HFileBlock$FSReaderImpl.readAtOffset(HFileBlock.java:1565) > at > org.apache.hadoop.hbase.io.hfile.HFileBlock$FSReaderImpl.readBlockDataInternal(HFileBlock.java:1769) > at > org.apache.hadoop.hbase.io.hfile.HFileBlock$FSReaderImpl.readBlockData(HFileBlock.java:1594) > at > org.apache.hadoop.hbase.io.hfile.HFileReaderImpl.readBlock(HFileReaderImpl.java:1488) > at > org.apache.hadoop.hbase.io.hfile.HFileReaderImpl$1.run(HFileReaderImpl.java:278) > at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) > at java.util.concurrent.FutureTask.run(FutureTask.java:266) > at > java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) > at > java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) > at > java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) > at > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) > at java.lang.Thread.run(Thread.java:748){noformat} > The relevant Hadoop code: > {code:java|title=BlockReaderRemote#sendReadResult} > void sendReadResult(Status statusCode) { > assert !sentStatusCode : "already sent status code to " + peer; > try { > writeReadResult(peer.getOutputStream(), statusCode); > sentStatusCode = true; > } catch (IOException e) { > // It's ok not to be able to send this. But something is probably wrong. > LOG.info("Could not send read status (" + statusCode + ") to datanode " + > peer.getRemoteAddressString() + ": " + e.getMessage()); > } > } > {code} > So the NPE was thrown within a exception handler. A possible explanation > could be that the socket was closed so client couldn't write, and > Socket#getRemoteSocketAddress() returns null when the socket is closed. > Suggest check for nullity and return an empty string in > NioInetPeer.getRemoteAddressString. -- 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