Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-3984

NullPointerException in IgniteCacheProxy when creating continuous query

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.7
    • None
    • cache
    • None

    Description

      Test attached. This used to work fine in 1.6.

      Exception in thread "main" javax.cache.CacheException: java.lang.NullPointerException
      	at org.apache.ignite.internal.processors.cache.IgniteCacheProxy.query(IgniteCacheProxy.java:709)
      	at ContQueryTest.main(ContQueryTest.java:33)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)
      Caused by: java.lang.NullPointerException
      	at org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousQueryHandler.getOrCreatePartitionRecovery(CacheContinuousQueryHandler.java:835)
      	at org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousQueryHandler.waitTopologyFuture(CacheContinuousQueryHandler.java:543)
      	at org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousQueryManager.executeQuery0(CacheContinuousQueryManager.java:660)
      	at org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousQueryManager.executeQuery(CacheContinuousQueryManager.java:482)
      	at org.apache.ignite.internal.processors.cache.IgniteCacheProxy.queryContinuous(IgniteCacheProxy.java:611)
      	at org.apache.ignite.internal.processors.cache.IgniteCacheProxy.query(IgniteCacheProxy.java:669)
      	... 6 more
      

      This seem to be related to this jira and PR:
      https://issues.apache.org/jira/browse/IGNITE-3413
      https://github.com/apache/ignite/commit/89d64e74b697054a88c3a91433aaaf4f7fdd0284

      Here's the scenario:

      • First node starts with special attribute and creates a cache with the node filter that allows to deploy it only on nodes with this attribute
      • Second node starts without the attribute is started. When creating a continuous query to query the cache created by the first node, a NullPointerException is thrown.

      At first glance, it seems that because the NodeFilter prevented the GridContinuousProcessor.registerHandler() to be called , the ConcurrentMap<Integer, PartitionRecovery> rcvs is not initialized properly and NullPointerException is thrown on this line:

      @NotNull private PartitionRecovery getOrCreatePartitionRecovery(GridKernalContext ctx, int partId) {
              PartitionRecovery rec = rcvs.get(partId);
      

      Attachments

        1. ContQueryTest.java
          2 kB
          Jason Man

        Issue Links

          Activity

            People

              Unassigned Unassigned
              jasonman107 Jason Man
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated: