phoenix-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "William Shen (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (PHOENIX-5101) ScanningResultIterator getScanMetrics throws NPE
Date Tue, 30 Apr 2019 01:30:00 GMT

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

William Shen commented on PHOENIX-5101:
---------------------------------------

[~tdsilva], I am able to reproduce locally with a sample program running against test dataset
size of 1000000 rows generated using Pherf (sorry, not sure where to add an actual test because
I've yet to nail down the exact condition):

{code}
package test;

import java.sql.*;
import java.util.Properties;

import org.apache.phoenix.query.QueryServices;

public class NPEExample {
    public static void main(final String[] args) throws SQLException {
        Properties props = new Properties();
        props.setProperty(QueryServices.COLLECT_REQUEST_LEVEL_METRICS, "true");
        Connection conn = DriverManager.getConnection("jdbc:phoenix:localhost:2181", props);
        PreparedStatement stmt = conn.prepareStatement("SELECT * FROM PHERF.KEYWORDS_NOIDX
LIMIT 400000");
        ResultSet rs = stmt.executeQuery();

        try {
            while (rs.next()) {
                rs.getObject(0);
            }
        } finally {
            rs.close();
            stmt.close();
            conn.close();
        }
    }
}
{code}

will produce the following error
{code}
Exception in thread "main" org.apache.phoenix.exception.PhoenixIOException
	at org.apache.phoenix.util.ServerUtil.parseServerException(ServerUtil.java:144)
	at org.apache.phoenix.iterate.RoundRobinResultIterator.close(RoundRobinResultIterator.java:128)
	at org.apache.phoenix.iterate.DelegateResultIterator.close(DelegateResultIterator.java:39)
	at org.apache.phoenix.jdbc.PhoenixResultSet.close(PhoenixResultSet.java:176)
	at test.NPEExample.main(NPEExample.java:21)
Caused by: java.lang.NullPointerException
	at org.apache.phoenix.iterate.ScanningResultIterator.getScanMetrics(ScanningResultIterator.java:100)
	at org.apache.phoenix.iterate.ScanningResultIterator.close(ScanningResultIterator.java:80)
	at org.apache.phoenix.iterate.TableResultIterator.close(TableResultIterator.java:144)
	at org.apache.phoenix.iterate.LookAheadResultIterator$1.close(LookAheadResultIterator.java:42)
	at org.apache.phoenix.iterate.BaseResultIterators.close(BaseResultIterators.java:1442)
	at org.apache.phoenix.iterate.RoundRobinResultIterator.close(RoundRobinResultIterator.java:125)
	... 3 more
{code}

> ScanningResultIterator getScanMetrics throws NPE
> ------------------------------------------------
>
>                 Key: PHOENIX-5101
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-5101
>             Project: Phoenix
>          Issue Type: Bug
>    Affects Versions: 4.14.1
>            Reporter: Reid Chan
>            Assignee: Karan Mehta
>            Priority: Blocker
>             Fix For: 4.15.0, 5.1.0, 4.14.2
>
>         Attachments: PHOENIX-5101.414-HBase-1.4.001.patch
>
>          Time Spent: 50m
>  Remaining Estimate: 0h
>
> {code}
> java.lang.NullPointerException
> 	at org.apache.phoenix.iterate.ScanningResultIterator.getScanMetrics(ScanningResultIterator.java:92)
> 	at org.apache.phoenix.iterate.ScanningResultIterator.close(ScanningResultIterator.java:79)
> 	at org.apache.phoenix.iterate.TableResultIterator.close(TableResultIterator.java:144)
> 	at org.apache.phoenix.iterate.LookAheadResultIterator$1.close(LookAheadResultIterator.java:42)
> 	at org.apache.phoenix.iterate.BaseResultIterators.close(BaseResultIterators.java:1439)
> 	at org.apache.phoenix.iterate.MergeSortResultIterator.close(MergeSortResultIterator.java:44)
> 	at org.apache.phoenix.jdbc.PhoenixResultSet.close(PhoenixResultSet.java:176)
> 	at org.apache.phoenix.jdbc.PhoenixResultSet.next(PhoenixResultSet.java:807)
> 	at org.apache.calcite.avatica.jdbc.JdbcResultSet.frame(JdbcResultSet.java:148)
> 	at org.apache.calcite.avatica.jdbc.JdbcResultSet.create(JdbcResultSet.java:101)
> 	at org.apache.calcite.avatica.jdbc.JdbcResultSet.create(JdbcResultSet.java:81)
> 	at org.apache.calcite.avatica.jdbc.JdbcMeta.prepareAndExecute(JdbcMeta.java:759)
> 	at org.apache.calcite.avatica.remote.LocalService.apply(LocalService.java:206)
> 	at org.apache.calcite.avatica.remote.Service$PrepareAndExecuteRequest.accept(Service.java:927)
> 	at org.apache.calcite.avatica.remote.Service$PrepareAndExecuteRequest.accept(Service.java:879)
> 	at org.apache.calcite.avatica.remote.AbstractHandler.apply(AbstractHandler.java:94)
> 	at org.apache.calcite.avatica.remote.ProtobufHandler.apply(ProtobufHandler.java:46)
> 	at org.apache.calcite.avatica.server.AvaticaProtobufHandler$2.call(AvaticaProtobufHandler.java:123)
> 	at org.apache.calcite.avatica.server.AvaticaProtobufHandler$2.call(AvaticaProtobufHandler.java:121)
> 	at org.apache.phoenix.queryserver.server.QueryServer$PhoenixDoAsCallback$1.run(QueryServer.java:500)
> 	at java.security.AccessController.doPrivileged(Native Method)
> 	at javax.security.auth.Subject.doAs(Subject.java:422)
> 	at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1754)
> 	at org.apache.phoenix.queryserver.server.QueryServer$PhoenixDoAsCallback.doAsRemoteUser(QueryServer.java:497)
> 	at org.apache.calcite.avatica.server.HttpServer$Builder$1.doAsRemoteUser(HttpServer.java:884)
> 	at org.apache.calcite.avatica.server.AvaticaProtobufHandler.handle(AvaticaProtobufHandler.java:120)
> 	at org.apache.phoenix.shaded.org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:542)
> 	at org.apache.phoenix.shaded.org.eclipse.jetty.server.handler.HandlerList.handle(HandlerList.java:52)
> 	at org.apache.phoenix.shaded.org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
> 	at org.apache.phoenix.shaded.org.eclipse.jetty.server.Server.handle(Server.java:499)
> 	at org.apache.phoenix.shaded.org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:311)
> 	at org.apache.phoenix.shaded.org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257)
> 	at org.apache.phoenix.shaded.org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:544)
> 	at org.apache.phoenix.shaded.org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)
> 	at org.apache.phoenix.shaded.org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)
> 	at java.lang.Thread.run(Thread.java:745)
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message