ignite-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Александр Меньшиков <sharple...@gmail.com>
Subject Re: [jira] [Created] (IGNITE-4487) NPE on query execution
Date Fri, 23 Dec 2016 19:02:33 GMT
I found that: in inner class
'GridCacheQueryAdapter.ScanQueryFallbackClosableIterator' in constructor is
called with method 'init()', but method 'init()' cannot be called with an
empty field 'nodes'. In source code it looks like:


private ScanQueryFallbackClosableIterator(int part, GridCacheQueryAdapter
qry,
            GridCacheQueryManager qryMgr, GridCacheContext cctx) {
            this.qry = qry;
            this.qryMgr = qryMgr;
            this.cctx = cctx;
            this.part = part;

            nodes = fallbacks(cctx.discovery().topologyVersionEx());
            // !!! Here nodes.isEmpty()==true, and init() will fail in the
future. !!!
            init();
        }


I can fix it by adding some check in code, but i must know what behavior
are best in this case? As I understand it, the list of nodes is empty if
there are no nodes with the current partition, which means data loss, and
either need to return a meaningful exception, or ignore this situation. But
maybe I missed something.


2016-12-23 14:47 GMT+03:00 Dmitry Karachentsev (JIRA) <jira@apache.org>:

> Dmitry Karachentsev created IGNITE-4487:
> -------------------------------------------
>
>              Summary: NPE on query execution
>                  Key: IGNITE-4487
>                  URL: https://issues.apache.org/jira/browse/IGNITE-4487
>              Project: Ignite
>           Issue Type: Bug
>           Components: cache
>     Affects Versions: 1.8
>             Reporter: Dmitry Karachentsev
>              Fix For: 2.0
>
>
> NPE may be thrown when called destroyCache() and started querying.
>
> Attached example reproduces this case when GridDiscoveryManager#removeCacheFilter
> called but cache state haven't been changed to STOPPED
> org.apache.ignite.internal.processors.cache.GridCacheGateway#onStopped.
> {code:none}
> javax.cache.CacheException: class org.apache.ignite.IgniteCheckedException:
> null
>         at org.apache.ignite.internal.processors.cache.
> IgniteCacheProxy.query(IgniteCacheProxy.java:740)
>         at com.intellica.evam.engine.event.future.FutureEventWorker.
> processFutureEvents(FutureEventWorker.java:117)
>         at com.intellica.evam.engine.event.future.FutureEventWorker.run(
> FutureEventWorker.java:66)
> Caused by: class org.apache.ignite.IgniteCheckedException: null
>         at org.apache.ignite.internal.processors.query.GridQueryProcessor.
> executeQuery(GridQueryProcessor.java:1693)
>         at org.apache.ignite.internal.processors.cache.
> IgniteCacheProxy.query(IgniteCacheProxy.java:494)
>         at org.apache.ignite.internal.processors.cache.
> IgniteCacheProxy.query(IgniteCacheProxy.java:732)
>         ... 2 more
> Caused by: java.lang.NullPointerException
>         at org.apache.ignite.internal.processors.cache.query.
> GridCacheQueryAdapter$ScanQueryFallbackClosableIterator.init(
> GridCacheQueryAdapter.java:712)
>         at org.apache.ignite.internal.processors.cache.query.
> GridCacheQueryAdapter$ScanQueryFallbackClosableIterator.<init>(
> GridCacheQueryAdapter.java:677)
>         at org.apache.ignite.internal.processors.cache.query.
> GridCacheQueryAdapter$ScanQueryFallbackClosableIterator.<init>(
> GridCacheQueryAdapter.java:628)
>         at org.apache.ignite.internal.processors.cache.query.
> GridCacheQueryAdapter.executeScanQuery(GridCacheQueryAdapter.java:548)
>         at org.apache.ignite.internal.processors.cache.
> IgniteCacheProxy$2.applyx(IgniteCacheProxy.java:497)
>         at org.apache.ignite.internal.processors.cache.
> IgniteCacheProxy$2.applyx(IgniteCacheProxy.java:495)
>         at org.apache.ignite.internal.util.lang.IgniteOutClosureX.
> apply(IgniteOutClosureX.java:36)
>         at org.apache.ignite.internal.processors.query.GridQueryProcessor.
> executeQuery(GridQueryProcessor.java:1670)
>         ... 4 more
> {code}
>
>
>
>
>
>
> --
> This message was sent by Atlassian JIRA
> (v6.3.4#6332)
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message