Polling container didn't have a graceful shutdown when using a DynamicEventTemplate in combination with a SQLQuery

Description

Stacktrace:
2017-03-20 09:01:07 [main] INFO o.o.p.c.s.ResourceApplicationContext - Closing org.openspaces.pu.container.support.ResourceApplicationContext@7dc222ae: startup date [Mon Mar 20 09:00:48 CET 2017]; root of context hierarchy
2017-03-20 09:01:07 [GS-importListener-13] ERROR o.o.e.p.SimplePollingEventListenerContainer - [importListener] Setup of event listener invoker failed - trying to recover
org.openspaces.core.BadSqlQueryException: Failed to execute SQLQuery : [runAfter is null OR runAfter < ?] cause: java.sql.SQLException: Select failed; Cause: java.sql.SQLException: Failed to execute readMultiple: java.lang.InterruptedException; nested exception is com.j_spaces.core.client.sql.SQLQueryException: Failed to execute SQLQuery : [runAfter is null OR runAfter < ?] cause: java.sql.SQLException: Select failed; Cause: java.sql.SQLException: Failed to execute readMultiple: java.lang.InterruptedException
at org.openspaces.core.exception.DefaultExceptionTranslator.internalTranslate(DefaultExceptionTranslator.java:154)
at org.openspaces.core.exception.DefaultExceptionTranslator.translate(DefaultExceptionTranslator.java:51)
at org.openspaces.core.DefaultGigaSpace.read(DefaultGigaSpace.java:492)
at org.openspaces.core.DefaultGigaSpace.read(DefaultGigaSpace.java:484)
at org.openspaces.events.polling.trigger.ReadTriggerOperationHandler.triggerReceive(ReadTriggerOperationHandler.java:55)
at org.openspaces.events.polling.SimplePollingEventListenerContainer.receiveAndExecute(SimplePollingEventListenerContainer.java:910)
at org.openspaces.events.polling.SimplePollingEventListenerContainer$AsyncEventListenerInvoker.invokeListener(SimplePollingEventListenerContainer.java:864)
at org.openspaces.events.polling.SimplePollingEventListenerContainer$AsyncEventListenerInvoker.run(SimplePollingEventListenerContainer.java:805)
at java.lang.Thread.run(Thread.java:745)
Caused by: com.j_spaces.core.client.sql.SQLQueryException: Failed to execute SQLQuery : [runAfter is null OR runAfter < ?] cause: java.sql.SQLException: Select failed; Cause: java.sql.SQLException: Failed to execute readMultiple: java.lang.InterruptedException
at com.j_spaces.core.client.sql.QueryManager.readTake(QueryManager.java:187)
at com.j_spaces.core.client.sql.QueryManager.readTake(QueryManager.java:125)
at com.gigaspaces.internal.client.spaceproxy.actions.SpaceProxyImplReadTakeAction.readTake(SpaceProxyImplReadTakeAction.java:51)
at com.gigaspaces.internal.client.spaceproxy.actions.SpaceProxyImplReadTakeAction.read(SpaceProxyImplReadTakeAction.java:33)
at com.gigaspaces.internal.client.spaceproxy.actions.SpaceProxyImplReadTakeAction.read(SpaceProxyImplReadTakeAction.java:27)
at com.gigaspaces.internal.client.spaceproxy.actions.AbstractSpaceProxyActionManager.read(AbstractSpaceProxyActionManager.java:170)
at com.gigaspaces.internal.client.spaceproxy.actions.AbstractSpaceProxyActionManager.read(AbstractSpaceProxyActionManager.java:150)
at com.gigaspaces.internal.client.spaceproxy.AbstractSpaceProxy.read(AbstractSpaceProxy.java:212)
at org.openspaces.core.DefaultGigaSpace.read(DefaultGigaSpace.java:490)
... 6 common frames omitted
Caused by: java.sql.SQLException: Select failed; Cause: java.sql.SQLException: Failed to execute readMultiple: java.lang.InterruptedException
at com.j_spaces.jdbc.SelectQuery.executeOnSpace(SelectQuery.java:292)
at com.j_spaces.core.client.sql.QueryManager.readTake(QueryManager.java:181)
... 14 common frames omitted
Caused by: java.sql.SQLException: Failed to execute readMultiple: java.lang.InterruptedException
at com.j_spaces.jdbc.executor.AbstractQueryExecutor.executeTemplate(AbstractQueryExecutor.java:229)
at com.j_spaces.jdbc.executor.QueryExecutor.execute(QueryExecutor.java:51)
at com.j_spaces.jdbc.parser.OrNode.accept(OrNode.java:74)
at com.j_spaces.jdbc.executor.AbstractQueryExecutor.traverseExpressionTree(AbstractQueryExecutor.java:182)
at com.j_spaces.jdbc.executor.QueryExecutor.execute(QueryExecutor.java:252)
at com.j_spaces.jdbc.SelectQuery.executeQuery(SelectQuery.java:365)
at com.j_spaces.jdbc.SelectQuery.executeOnSpace(SelectQuery.java:228)
... 15 common frames omitted
Caused by: java.lang.InterruptedException: null
at java.lang.Object.wait(Native Method)
at com.gigaspaces.internal.server.space.SpaceEngine.waitForBlockingAnswer(SpaceEngine.java:1373)
at com.gigaspaces.internal.server.space.SpaceEngine.unsafeRead_impl(SpaceEngine.java:1335)
at com.gigaspaces.internal.server.space.SpaceEngine.unsafeRead(SpaceEngine.java:1218)
at com.gigaspaces.internal.server.space.SpaceEngine.read(SpaceEngine.java:1194)
at com.gigaspaces.internal.server.space.SpaceImpl.readNew(SpaceImpl.java:2158)
at com.gigaspaces.internal.server.space.operations.ReadTakeEntrySpaceOperation.execute(ReadTakeEntrySpaceOperation.java:33)
at com.gigaspaces.internal.server.space.operations.ReadTakeEntrySpaceOperation.execute(ReadTakeEntrySpaceOperation.java:23)
at com.gigaspaces.internal.server.space.operations.SpaceOperationsExecutor.executeOperation(SpaceOperationsExecutor.java:78)
at com.gigaspaces.internal.server.space.SpaceImpl.executeOperation(SpaceImpl.java:1872)
at com.gigaspaces.internal.lrmi.stubs.LRMISpaceImpl.executeOperation(LRMISpaceImpl.java:636)
at com.gigaspaces.internal.remoting.routing.embedded.EmbeddedRemoteOperationRouter.executeImpl(EmbeddedRemoteOperationRouter.java:75)
at com.gigaspaces.internal.remoting.routing.embedded.EmbeddedRemoteOperationRouter.execute(EmbeddedRemoteOperationRouter.java:60)
at com.gigaspaces.internal.client.spaceproxy.router.SpaceProxyRouter.execute(SpaceProxyRouter.java:232)
at com.gigaspaces.internal.client.spaceproxy.actions.SpaceProxyImplReadTakeAction.readTake(SpaceProxyImplReadTakeAction.java:63)
at com.gigaspaces.internal.client.spaceproxy.actions.SpaceProxyImplReadTakeAction.read(SpaceProxyImplReadTakeAction.java:33)
at com.gigaspaces.internal.client.spaceproxy.actions.SpaceProxyImplReadTakeAction.read(SpaceProxyImplReadTakeAction.java:27)
at com.gigaspaces.internal.client.spaceproxy.actions.AbstractSpaceProxyActionManager.read(AbstractSpaceProxyActionManager.java:170)
at com.gigaspaces.internal.client.spaceproxy.actions.AbstractSpaceProxyActionManager.read(AbstractSpaceProxyActionManager.java:150)
at com.gigaspaces.internal.client.spaceproxy.AbstractSpaceProxy.read(AbstractSpaceProxy.java:217)
at com.j_spaces.jdbc.builder.QueryTemplatePacket.read(QueryTemplatePacket.java:836)
at com.j_spaces.jdbc.builder.QueryTemplatePacket.read(QueryTemplatePacket.java:819)
at com.j_spaces.jdbc.executor.AbstractQueryExecutor.executeTemplate(AbstractQueryExecutor.java:215)
... 21 common frames omitted
2017-03-20 09:01:12,045 INFO [com.gigaspaces.space.offerImportSpace.1] - Beginning shutdown...

Workaround

None

Acceptance Test

com.gigaspaces.test.support.PriceRunner.case11062.PollingContainerShutdown

Status

Assignee

Niv Ingberg

Reporter

Ester Atzmon

Labels

None

Priority

Medium

SalesForce Case ID

11062

Fix versions

Commitment Version/s

None

Due date

None

Product

None

Edition

None

Platform

All
Configure