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

ASF GitHub Bot commented on GEODE-8346:
---------------------------------------

DonalEvans opened a new pull request #5359:
URL: https://github.com/apache/geode/pull/5359


   Authored-by: Donal Evans <doev...@vmware.com>
   
   Thank you for submitting a contribution to Apache Geode.
   
   In order to streamline the review of the contribution we ask you
   to ensure the following steps have been taken:
   
   ### For all changes:
   - [x] Is there a JIRA ticket associated with this PR? Is it referenced in 
the commit message?
   
   - [x] Has your PR been rebased against the latest commit within the target 
branch (typically `develop`)?
   
   - [x] Is your initial contribution a single, squashed commit?
   
   - [x] Does `gradlew build` run cleanly?
   
   - [x] Have you written or updated unit tests to verify your changes?
   
   - [N/A] If adding new dependencies to the code, are these dependencies 
licensed in a way that is compatible for inclusion under [ASF 
2.0](http://www.apache.org/legal/resolved.html#category-a)?
   
   ### Note:
   Please ensure that once the PR is submitted, check Concourse for build 
issues and
   submit an update to your PR as soon as possible. If you need help, please 
send an
   email to d...@geode.apache.org.
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> NonTXEntry.getValue() may throw EntryDestroyedException during CQ execution
> ---------------------------------------------------------------------------
>
>                 Key: GEODE-8346
>                 URL: https://issues.apache.org/jira/browse/GEODE-8346
>             Project: Geode
>          Issue Type: Bug
>          Components: cq
>    Affects Versions: 1.14.0
>            Reporter: Donal Evans
>            Assignee: Donal Evans
>            Priority: Major
>
> If a region entry is destroyed at the same time that a CQ is executed, there 
> exists a race condition where a non-destroyed {{NonTXEntry}} is retrieved 
> during iteration of results in {{CompiledSelect.doNestedIterations()}} but is 
> marked as destroyed/removed before {{NonTXEntry.getValue()}} is called in 
> {{CompiledComparison.evaluate()}}, which results in an 
> {{EntryDestroyedException}} being thrown.
> {noformat}
> org.apache.geode.cache.query.CqException: Failed to execute the CQ. CqName: 
> testCQ, Query String is: SELECT * FROM /testRegion entry WHERE entry = NULL, 
> Error from last server: remote server on 
> 10.212.3.32(84004:loner):49205:d737a530: While performing a remote 
> createCQfetchInitialResult
>       at 
> org.apache.geode.cache.query.cq.internal.ClientCQImpl.executeCqOnRedundantsAndPrimary(ClientCQImpl.java:435)
>       at 
> org.apache.geode.cache.query.cq.internal.ClientCQImpl.executeWithInitialResults(ClientCQImpl.java:303)
>       at 
> org.apache.geode.cache.query.cq.DonalCQTest.lambda$test$bb17a952$2(DonalCQTest.java:84)
>       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 
> org.apache.geode.test.dunit.internal.MethodInvoker.executeObject(MethodInvoker.java:123)
>       at 
> org.apache.geode.test.dunit.internal.RemoteDUnitVM.executeMethodOnObject(RemoteDUnitVM.java:78)
>       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 sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:357)
>       at sun.rmi.transport.Transport$1.run(Transport.java:200)
>       at sun.rmi.transport.Transport$1.run(Transport.java:197)
>       at java.security.AccessController.doPrivileged(Native Method)
>       at sun.rmi.transport.Transport.serviceCall(Transport.java:196)
>       at 
> sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:573)
>       at 
> sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:834)
>       at 
> sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:688)
>       at java.security.AccessController.doPrivileged(Native Method)
>       at 
> sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:687)
>       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)
> Caused by: org.apache.geode.cache.client.ServerOperationException: remote 
> server on 10.212.3.32(84004:loner):49205:d737a530: While performing a remote 
> createCQfetchInitialResult
>       at 
> org.apache.geode.cache.client.internal.AbstractOp.processChunkedResponse(AbstractOp.java:340)
>       at 
> org.apache.geode.cache.client.internal.QueryOp$QueryOpImpl.processResponse(QueryOp.java:168)
>       at 
> org.apache.geode.cache.client.internal.AbstractOp.processResponse(AbstractOp.java:222)
>       at 
> org.apache.geode.cache.client.internal.AbstractOp.attemptReadResponse(AbstractOp.java:195)
>       at 
> org.apache.geode.cache.client.internal.AbstractOp.attempt(AbstractOp.java:382)
>       at 
> org.apache.geode.cache.client.internal.ConnectionImpl.execute(ConnectionImpl.java:283)
>       at 
> org.apache.geode.cache.client.internal.QueueConnectionImpl.execute(QueueConnectionImpl.java:191)
>       at 
> org.apache.geode.cache.client.internal.OpExecutorImpl.executeWithPossibleReAuthentication(OpExecutorImpl.java:753)
>       at 
> org.apache.geode.cache.client.internal.OpExecutorImpl.executeOnQueuesAndReturnPrimaryResult(OpExecutorImpl.java:454)
>       at 
> org.apache.geode.cache.client.internal.PoolImpl.executeOnQueuesAndReturnPrimaryResult(PoolImpl.java:870)
>       at 
> org.apache.geode.cache.query.cq.internal.ops.CreateCQWithIROp.execute(CreateCQWithIROp.java:45)
>       at 
> org.apache.geode.cache.query.cq.internal.ops.ServerCQProxyImpl.createWithIR(ServerCQProxyImpl.java:88)
>       at 
> org.apache.geode.cache.query.cq.internal.ClientCQImpl.executeCqOnRedundantsAndPrimary(ClientCQImpl.java:404)
>       ... 25 more
> Caused by: org.apache.geode.cache.EntryDestroyedException: key
>       at 
> org.apache.geode.internal.cache.NonTXEntry.basicGetEntry(NonTXEntry.java:65)
>       at 
> org.apache.geode.internal.cache.NonTXEntry.getValue(NonTXEntry.java:94)
>       at 
> org.apache.geode.internal.cache.NonTXEntry.getValue(NonTXEntry.java:89)
>       at 
> org.apache.geode.cache.query.internal.CompiledComparison.evaluate(CompiledComparison.java:91)
>       at 
> org.apache.geode.cache.query.internal.CompiledSelect.doNestedIterations(CompiledSelect.java:779)
>       at 
> org.apache.geode.cache.query.internal.CompiledSelect.doNestedIterations(CompiledSelect.java:849)
>       at 
> org.apache.geode.cache.query.internal.CompiledSelect.doIterationEvaluate(CompiledSelect.java:706)
>       at 
> org.apache.geode.cache.query.internal.CompiledSelect.evaluate(CompiledSelect.java:548)
>       at 
> org.apache.geode.cache.query.internal.CompiledSelect.evaluate(CompiledSelect.java:54)
>       at 
> org.apache.geode.cache.query.internal.DefaultQuery.executeUsingContext(DefaultQuery.java:357)
>       at 
> org.apache.geode.cache.query.internal.DefaultQuery.execute(DefaultQuery.java:264)
>       at 
> org.apache.geode.cache.query.internal.DefaultQuery.execute(DefaultQuery.java:197)
>       at 
> org.apache.geode.internal.cache.tier.sockets.BaseCommandQuery.processQueryUsingParams(BaseCommandQuery.java:122)
>       at 
> org.apache.geode.internal.cache.tier.sockets.BaseCommandQuery.processQuery(BaseCommandQuery.java:68)
>       at 
> org.apache.geode.cache.query.cq.internal.command.ExecuteCQ61.cmdExecute(ExecuteCQ61.java:183)
>       at 
> org.apache.geode.internal.cache.tier.sockets.BaseCommand.execute(BaseCommand.java:183)
>       at 
> org.apache.geode.internal.cache.tier.sockets.ServerConnection.doNormalMessage(ServerConnection.java:848)
>       at 
> org.apache.geode.internal.cache.tier.sockets.OriginalServerConnection.doOneMessage(OriginalServerConnection.java:72)
>       at 
> org.apache.geode.internal.cache.tier.sockets.ServerConnection.run(ServerConnection.java:1212)
>       at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
>       at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
>       at 
> org.apache.geode.internal.cache.tier.sockets.AcceptorImpl.lambda$initializeServerConnectionThreadPool$3(AcceptorImpl.java:686)
>       at 
> org.apache.geode.logging.internal.executors.LoggingThreadFactory.lambda$newThread$0(LoggingThreadFactory.java:119)
>       ... 1 more
> {noformat}
> Surrounding the calls to {{NonTXEntry.getValue()}} in 
> {{CompiledComparison.evaluate()}} with a try/catch block that handles the 
> {{EntryDestroyedException}} will prevent this failure.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to