neo4j-apoc-procedures
neo4j-apoc-procedures copied to clipboard
Neo4j 5.15.0-enterprise Failed to invoke procedure `apoc.cypher.mapParallel2` Caused by: java.lang.RuntimeException: Error polling, timeout of 10 seconds reached
My tests fails on Neo4j 5.15.0-enterprise (5.13.0 everything is working fine) with the following exception:
org.neo4j.driver.exceptions.ClientException: Failed to invoke procedure `apoc.cypher.mapParallel2`: Caused by: java.lang.RuntimeException: Error polling, timeout of 10 seconds reached.
at org.neo4j.driver.internal.util.Futures.blockingGet(Futures.java:108)
at org.neo4j.driver.internal.InternalResult.blockingGet(InternalResult.java:109)
at org.neo4j.driver.internal.InternalResult.list(InternalResult.java:85)
at org.neo4j.ogm.drivers.bolt.response.RestModelResponse.<init>(RestModelResponse.java:49)
at org.neo4j.ogm.drivers.bolt.request.BoltRequest.execute(BoltRequest.java:169)
at org.neo4j.ogm.session.delegates.ExecuteQueriesDelegate.lambda$query$0(ExecuteQueriesDelegate.java:147)
at org.neo4j.ogm.session.Neo4jSession.doInTransaction(Neo4jSession.java:600)
at org.neo4j.ogm.session.Neo4jSession.doInTransaction(Neo4jSession.java:574)
at org.neo4j.ogm.session.delegates.ExecuteQueriesDelegate.query(ExecuteQueriesDelegate.java:145)
at org.neo4j.ogm.session.Neo4jSession.query(Neo4jSession.java:445)
at jdk.internal.reflect.GeneratedMethodAccessor74.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.springframework.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:281)
at org.springframework.data.neo4j.transaction.SharedSessionCreator$SharedSessionInvocationHandler.lambda$invoke$0(SharedSessionCreator.java:119)
at org.springframework.data.neo4j.transaction.SharedSessionCreator$SharedSessionInvocationHandler.invokeInTransaction(SharedSessionCreator.java:159)
at org.springframework.data.neo4j.transaction.SharedSessionCreator$SharedSessionInvocationHandler.invoke(SharedSessionCreator.java:123)
at jdk.proxy2/jdk.proxy2.$Proxy114.query(Unknown Source)
at com.example.domain.service.neo4j.company.job.JobableServiceUtils.findAllDecisionMatrixPageByJobableId(JobableServiceUtils.java:424)
at com.example.domain.service.neo4j.company.profile.ProfileServiceImpl.findProfileDecisionMatricesByVacancyId(ProfileServiceImpl.java:1027)
at com.example.domain.service.neo4j.company.profile.ProfileServiceImpl.findProfileDecisionMatricesByVacancyId(ProfileServiceImpl.java:1011)
at com.example.domain.service.neo4j.company.profile.ProfileServiceImpl.findProfileDecisionMatricesByVacancyId(ProfileServiceImpl.java:1005)
at com.example.domain.service.neo4j.company.profile.ProfileServiceImpl.findProfileDecisionMatricesByVacancyId(ProfileServiceImpl.java:999)
at jdk.internal.reflect.GeneratedMethodAccessor227.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:352)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:196)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:765)
at org.springframework.validation.beanvalidation.MethodValidationInterceptor.invoke(MethodValidationInterceptor.java:174)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:765)
at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:123)
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:385)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:119)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:765)
at org.springframework.retry.annotation.AnnotationAwareRetryOperationsInterceptor.invoke(AnnotationAwareRetryOperationsInterceptor.java:164)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:765)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:717)
at com.example.domain.service.neo4j.company.profile.ProfileServiceImpl$$SpringCGLIB$$0.findProfileDecisionMatricesByVacancyId(<generated>)
at com.example.domain.service.neo4j.company.vacancy.VacancyServiceIT.queryVacanciesByCandidatesTakingEachVacancyCriterionCoefficients(VacancyServiceIT.java:260)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.springframework.test.context.junit4.statements.RunBeforeTestExecutionCallbacks.evaluate(RunBeforeTestExecutionCallbacks.java:76)
at org.springframework.test.context.junit4.statements.RunAfterTestExecutionCallbacks.evaluate(RunAfterTestExecutionCallbacks.java:84)
at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:75)
at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:86)
at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:84)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:252)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:97)
at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:191)
Suppressed: org.neo4j.driver.internal.util.ErrorUtil$InternalExceptionCause
at org.neo4j.driver.internal.util.ErrorUtil.newNeo4jError(ErrorUtil.java:76)
at org.neo4j.driver.internal.async.inbound.InboundMessageDispatcher.handleFailureMessage(InboundMessageDispatcher.java:111)
at org.neo4j.driver.internal.messaging.common.CommonMessageReader.unpackFailureMessage(CommonMessageReader.java:62)
at org.neo4j.driver.internal.messaging.common.CommonMessageReader.read(CommonMessageReader.java:46)
at org.neo4j.driver.internal.async.inbound.InboundMessageHandler.channelRead0(InboundMessageHandler.java:78)
at org.neo4j.driver.internal.async.inbound.InboundMessageHandler.channelRead0(InboundMessageHandler.java:34)
at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:99)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:346)
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:318)
at org.neo4j.driver.internal.async.inbound.MessageDecoder.channelRead(MessageDecoder.java:40)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:346)
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:318)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
at io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:286)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:440)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:788)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:724)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:650)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:562)
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.base/java.lang.Thread.run(Thread.java:833)
This is the logs:
Also, please do not deprecate this procedure https://github.com/neo4j-contrib/neo4j-apoc-procedures/issues/3843
@alexanoid I tested some queries present in query.log, but everything works fine for me.
You can provide the query(s) that produce that error and, if possible, a dataset that can replicate it.
Hi @vga91 , thanks for your answer!
Please use the following dataset (with Neo4j 5.15.0-enterprise, block store, apoc-5.15.0-extended.jar, apoc-5.15.1-core.jar):
with the following query:
MATCH (dg:DecisionGroup {
id: 1
})-[rdgd: CONTAINS ]-> ( childD:Decision )
WITH childD
WITH collect({`childD`:childD}) AS childDDgRdgd CALL apoc.cypher.mapParallel2("
WITH _.childD AS childD
OPTIONAL MATCH (childD)-[vg:HAS_VOTE_ON]->(c:Criterion)
WHERE c.id IN $cIds
WITH childD, vg.avgVotesWeight AS weight, vg.totalVotes AS totalVotes
WITH childD , toFloat(sum(weight)) AS weight, toInteger(sum(totalVotes)) AS totalVotes
RETURN childD, weight, totalVotes ", {
`cIds`:[3, 2, 1]
}, childDDgRdgd, 6, 10) YIELD value AS value
WITH value.childD AS childD, value.weight AS weight, value.totalVotes AS totalVotes
WITH collect({`childD`:childD , `weight`:weight, `totalVotes`: totalVotes }) AS aggregate
WITH aggregate, size(aggregate) AS count
UNWIND aggregate AS item
WITH count, item.childD AS childD , item.weight AS weight, item.totalVotes AS totalVotes ORDER BY totalVotes DESC, childD.createdAt DESC SKIP 0
LIMIT 100
MATCH (dg:DecisionGroup {
id: 1
})-[rdgd: CONTAINS ]->(childD)
OPTIONAL MATCH (childD)-[ru:CREATED_BY]->(u:User)
RETURN count, childD AS decision, dg, rdgd , u, ru , weight, totalVotes, [ (c1:Criterion)<-[vg1:HAS_VOTE_ON]-(childD)
WHERE c1.id IN [3, 2, 1] | {
criterion: c1, relationship: vg1
} ] AS weightedCriteria , [ (c1:Criterion)-[: CONTAINS ]->(uv:Vote)<-[: CONTAINS ]-(childD)
WHERE c1.id IN [3, 2, 1] AND ((uv)-[:CREATED_BY]->(:User {
uuid: 'd8bac95d-302c-4b11-a5d6-0209ee26b6b0'
})) AND NOT ((:Vote)-[: CONTAINS ]->(uv)) | {
criterionId: c1.id, vote: uv
} ] AS userVotes , [ (childD)-[: CONTAINS ]->(role:Role)<-[: CONTAINS ]-(user:User {
uuid: 'd8bac95d-302c-4b11-a5d6-0209ee26b6b0'
}) | {
role: role
} ] AS decisionUserRoles, [ (rc:Criterion)-[*0]->()
WHERE rc.id IN childD.replaceableCriterionIds | {
entity: rc
} ] AS decisionReplaceableCriteria ORDER BY totalVotes DESC, childD.createdAt DESC
Execute this query in the Neo4j web console. This error occurs unexpectedly, so you may have to execute this query repeatedly until the error occurs:
Neo.ClientError.Procedure.ProcedureCallFailed
Failed to invoke procedure `apoc.cypher.mapParallel2`: Caused by: java.lang.RuntimeException: Error polling, timeout of 10 seconds reached.