You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "Yves Langisch (Created) (JIRA)" <ji...@apache.org> on 2012/01/10 17:27:39 UTC

[jira] [Created] (HBASE-5171) Potential NullPointerException while obtaining row lock

Potential NullPointerException while obtaining row lock 
--------------------------------------------------------

                 Key: HBASE-5171
                 URL: https://issues.apache.org/jira/browse/HBASE-5171
             Project: HBase
          Issue Type: Bug
          Components: regionserver
    Affects Versions: 0.90.5
            Reporter: Yves Langisch


We have a table which is concurrently accessed (read/write) from many threads and we make use of row locks. Under heavy load we regularly get NPE while obtaining row locks. An example stack trace looks as follows:

java.lang.NullPointerException
      at org.apache.hadoop.hbase.regionserver.HRegionServer.convertThrowableToIOE(HRegionServer.java:986)
      at org.apache.hadoop.hbase.regionserver.HRegionServer.lockRow(HRegionServer.java:2008)
      at sun.reflect.GeneratedMethodAccessor20.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.apache.hadoop.hbase.ipc.HBaseRPC$Server.call(HBaseRPC.java:570)
      at org.apache.hadoop.hbase.ipc.HBaseServer$Handler.run(HBaseServer.java:1039)
Caused by: java.lang.NullPointerException
      at java.util.concurrent.ConcurrentHashMap.put(ConcurrentHashMap.java:881)
      at org.apache.hadoop.hbase.regionserver.HRegionServer.addRowLock(HRegionServer.java:2018)
      at org.apache.hadoop.hbase.regionserver.HRegionServer.lockRow(HRegionServer.java:2004)
      ... 5 more 

After checking the source code I've noticed that the value which is going to be put into the HashMap can be null in the case where the waitForLock flag is true or the rowLockWaitDuration is expired (HRegion#internalObtainRowLock, line 2111ff). The latter I think happens in our case as we have heavy load hitting the server.

IMHO this case should be handled somehow and must not lead to a NPE.

-
Yves

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HBASE-5171) Potential NullPointerException while obtaining row lock

Posted by "Zhihong Yu (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-5171?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13183425#comment-13183425 ] 

Zhihong Yu commented on HBASE-5171:
-----------------------------------

@Yves:
Do you want to provide a patch ?

I think one approach is to create an IOException subclass, similar to UnknownRowLockException, for the scenario where wait duration expires.
                
> Potential NullPointerException while obtaining row lock 
> --------------------------------------------------------
>
>                 Key: HBASE-5171
>                 URL: https://issues.apache.org/jira/browse/HBASE-5171
>             Project: HBase
>          Issue Type: Bug
>          Components: regionserver
>    Affects Versions: 0.90.5
>            Reporter: Yves Langisch
>
> We have a table which is concurrently accessed (read/write) from many threads and we make use of row locks. Under heavy load we regularly get NPE while obtaining row locks. An example stack trace looks as follows:
> java.lang.NullPointerException
>       at org.apache.hadoop.hbase.regionserver.HRegionServer.convertThrowableToIOE(HRegionServer.java:986)
>       at org.apache.hadoop.hbase.regionserver.HRegionServer.lockRow(HRegionServer.java:2008)
>       at sun.reflect.GeneratedMethodAccessor20.invoke(Unknown Source)
>       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>       at java.lang.reflect.Method.invoke(Method.java:597)
>       at org.apache.hadoop.hbase.ipc.HBaseRPC$Server.call(HBaseRPC.java:570)
>       at org.apache.hadoop.hbase.ipc.HBaseServer$Handler.run(HBaseServer.java:1039)
> Caused by: java.lang.NullPointerException
>       at java.util.concurrent.ConcurrentHashMap.put(ConcurrentHashMap.java:881)
>       at org.apache.hadoop.hbase.regionserver.HRegionServer.addRowLock(HRegionServer.java:2018)
>       at org.apache.hadoop.hbase.regionserver.HRegionServer.lockRow(HRegionServer.java:2004)
>       ... 5 more 
> After checking the source code I've noticed that the value which is going to be put into the HashMap can be null in the case where the waitForLock flag is true or the rowLockWaitDuration is expired (HRegion#internalObtainRowLock, line 2111ff). The latter I think happens in our case as we have heavy load hitting the server.
> IMHO this case should be handled somehow and must not lead to a NPE.
> -
> Yves

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (HBASE-5171) Potential NullPointerException while obtaining row lock

Posted by "stack (Resolved) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HBASE-5171?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

stack resolved HBASE-5171.
--------------------------

    Resolution: Duplicate

This patch was opened first but will mark as duplicate of hbase-5249 because thats where the action is.
                
> Potential NullPointerException while obtaining row lock 
> --------------------------------------------------------
>
>                 Key: HBASE-5171
>                 URL: https://issues.apache.org/jira/browse/HBASE-5171
>             Project: HBase
>          Issue Type: Bug
>          Components: regionserver
>    Affects Versions: 0.90.5
>            Reporter: Yves Langisch
>
> We have a table which is concurrently accessed (read/write) from many threads and we make use of row locks. Under heavy load we regularly get NPE while obtaining row locks. An example stack trace looks as follows:
> java.lang.NullPointerException
>       at org.apache.hadoop.hbase.regionserver.HRegionServer.convertThrowableToIOE(HRegionServer.java:986)
>       at org.apache.hadoop.hbase.regionserver.HRegionServer.lockRow(HRegionServer.java:2008)
>       at sun.reflect.GeneratedMethodAccessor20.invoke(Unknown Source)
>       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>       at java.lang.reflect.Method.invoke(Method.java:597)
>       at org.apache.hadoop.hbase.ipc.HBaseRPC$Server.call(HBaseRPC.java:570)
>       at org.apache.hadoop.hbase.ipc.HBaseServer$Handler.run(HBaseServer.java:1039)
> Caused by: java.lang.NullPointerException
>       at java.util.concurrent.ConcurrentHashMap.put(ConcurrentHashMap.java:881)
>       at org.apache.hadoop.hbase.regionserver.HRegionServer.addRowLock(HRegionServer.java:2018)
>       at org.apache.hadoop.hbase.regionserver.HRegionServer.lockRow(HRegionServer.java:2004)
>       ... 5 more 
> After checking the source code I've noticed that the value which is going to be put into the HashMap can be null in the case where the waitForLock flag is true or the rowLockWaitDuration is expired (HRegion#internalObtainRowLock, line 2111ff). The latter I think happens in our case as we have heavy load hitting the server.
> IMHO this case should be handled somehow and must not lead to a NPE.
> -
> Yves

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HBASE-5171) Potential NullPointerException while obtaining row lock

Posted by "Zhihong Yu (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-5171?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13183429#comment-13183429 ] 

Zhihong Yu commented on HBASE-5171:
-----------------------------------

One workaround is to increase the value for "hbase.rowlock.wait.duration"
But a new exception should be introduced anyways.
                
> Potential NullPointerException while obtaining row lock 
> --------------------------------------------------------
>
>                 Key: HBASE-5171
>                 URL: https://issues.apache.org/jira/browse/HBASE-5171
>             Project: HBase
>          Issue Type: Bug
>          Components: regionserver
>    Affects Versions: 0.90.5
>            Reporter: Yves Langisch
>
> We have a table which is concurrently accessed (read/write) from many threads and we make use of row locks. Under heavy load we regularly get NPE while obtaining row locks. An example stack trace looks as follows:
> java.lang.NullPointerException
>       at org.apache.hadoop.hbase.regionserver.HRegionServer.convertThrowableToIOE(HRegionServer.java:986)
>       at org.apache.hadoop.hbase.regionserver.HRegionServer.lockRow(HRegionServer.java:2008)
>       at sun.reflect.GeneratedMethodAccessor20.invoke(Unknown Source)
>       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>       at java.lang.reflect.Method.invoke(Method.java:597)
>       at org.apache.hadoop.hbase.ipc.HBaseRPC$Server.call(HBaseRPC.java:570)
>       at org.apache.hadoop.hbase.ipc.HBaseServer$Handler.run(HBaseServer.java:1039)
> Caused by: java.lang.NullPointerException
>       at java.util.concurrent.ConcurrentHashMap.put(ConcurrentHashMap.java:881)
>       at org.apache.hadoop.hbase.regionserver.HRegionServer.addRowLock(HRegionServer.java:2018)
>       at org.apache.hadoop.hbase.regionserver.HRegionServer.lockRow(HRegionServer.java:2004)
>       ... 5 more 
> After checking the source code I've noticed that the value which is going to be put into the HashMap can be null in the case where the waitForLock flag is true or the rowLockWaitDuration is expired (HRegion#internalObtainRowLock, line 2111ff). The latter I think happens in our case as we have heavy load hitting the server.
> IMHO this case should be handled somehow and must not lead to a NPE.
> -
> Yves

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira