Запустив пакетный оператор Cypher (CALL apoc.periodic.iterate()
в аннотации @Query
для Neo4jRepository
), я несколько раз сталкивался со следующей ошибочной ситуацией после нескольких часов вычислений.Neo4j 3.4.9, Enterprise Edition.
Neo4j debug.log
2018-11-20 13:09:50.297+0000 ERROR [o.n.b.t.p.ProtocolHandshaker] Fatal error occurred during protocol handshaking: [id: 0x7035fd8f, L:/127.0.0.1:7687 - R:/127.0.0.1:56319] Connection reset by peer
java.io.IOException: Connection reset by peer
at sun.nio.ch.FileDispatcherImpl.read0(Native Method)
at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:39)
at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223)
at sun.nio.ch.IOUtil.read(IOUtil.java:192)
at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:380)
at io.netty.buffer.PooledUnsafeDirectByteBuf.setBytes(PooledUnsafeDirectByteBuf.java:288)
at io.netty.buffer.AbstractByteBuf.writeBytes(AbstractByteBuf.java:1108)
at io.netty.channel.socket.nio.NioSocketChannel.doReadBytes(NioSocketChannel.java:345)
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:148)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:645)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:580)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:497)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:459)
at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:884)
at java.lang.Thread.run(Thread.java:748)
Контекст Spring Boot
org.neo4j.driver.v1.exceptions.ServiceUnavailableException: Connection to the database terminated. This can happen due to network instabilities, or due to restarts of the database
at org.neo4j.driver.internal.util.ErrorUtil.newConnectionTerminatedError(ErrorUtil.java:45) ~[neo4j-java-driver-1.6.3.jar:1.6.3-b33d284ef6f350edbfe9e8f4539cdcdb0200bd0b]
at org.neo4j.driver.internal.util.ErrorUtil.newConnectionTerminatedError(ErrorUtil.java:38) ~[neo4j-java-driver-1.6.3.jar:1.6.3-b33d284ef6f350edbfe9e8f4539cdcdb0200bd0b]
at org.neo4j.driver.internal.async.inbound.ChannelErrorHandler.channelInactive(ChannelErrorHandler.java:76) ~[neo4j-java-driver-1.6.3.jar:1.6.3-b33d284ef6f350edbfe9e8f4539cdcdb0200bd0b]
at org.neo4j.driver.internal.shaded.io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:245) ~[neo4j-java-driver-1.6.3.jar:1.6.3-b33d284ef6f350edbfe9e8f4539cdcdb0200bd0b]
at org.neo4j.driver.internal.shaded.io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:231) ~[neo4j-java-driver-1.6.3.jar:1.6.3-b33d284ef6f350edbfe9e8f4539cdcdb0200bd0b]
at org.neo4j.driver.internal.shaded.io.netty.channel.AbstractChannelHandlerContext.fireChannelInactive(AbstractChannelHandlerContext.java:224) ~[neo4j-java-driver-1.6.3.jar:1.6.3-b33d284ef6f350edbfe9e8f4539cdcdb0200bd0b]
at org.neo4j.driver.internal.shaded.io.netty.channel.ChannelInboundHandlerAdapter.channelInactive(ChannelInboundHandlerAdapter.java:75) ~[neo4j-java-driver-1.6.3.jar:1.6.3-b33d284ef6f350edbfe9e8f4539cdcdb0200bd0b]
at org.neo4j.driver.internal.shaded.io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:245) ~[neo4j-java-driver-1.6.3.jar:1.6.3-b33d284ef6f350edbfe9e8f4539cdcdb0200bd0b]
at org.neo4j.driver.internal.shaded.io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:231) ~[neo4j-java-driver-1.6.3.jar:1.6.3-b33d284ef6f350edbfe9e8f4539cdcdb0200bd0b]
at org.neo4j.driver.internal.shaded.io.netty.channel.AbstractChannelHandlerContext.fireChannelInactive(AbstractChannelHandlerContext.java:224) ~[neo4j-java-driver-1.6.3.jar:1.6.3-b33d284ef6f350edbfe9e8f4539cdcdb0200bd0b]
at org.neo4j.driver.internal.shaded.io.netty.handler.codec.ByteToMessageDecoder.channelInputClosed(ByteToMessageDecoder.java:377) ~[neo4j-java-driver-1.6.3.jar:1.6.3-b33d284ef6f350edbfe9e8f4539cdcdb0200bd0b]
at org.neo4j.driver.internal.shaded.io.netty.handler.codec.ByteToMessageDecoder.channelInactive(ByteToMessageDecoder.java:342) ~[neo4j-java-driver-1.6.3.jar:1.6.3-b33d284ef6f350edbfe9e8f4539cdcdb0200bd0b]
at org.neo4j.driver.internal.shaded.io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:245) ~[neo4j-java-driver-1.6.3.jar:1.6.3-b33d284ef6f350edbfe9e8f4539cdcdb0200bd0b]
at org.neo4j.driver.internal.shaded.io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:231) ~[neo4j-java-driver-1.6.3.jar:1.6.3-b33d284ef6f350edbfe9e8f4539cdcdb0200bd0b]
at org.neo4j.driver.internal.shaded.io.netty.channel.AbstractChannelHandlerContext.fireChannelInactive(AbstractChannelHandlerContext.java:224) ~[neo4j-java-driver-1.6.3.jar:1.6.3-b33d284ef6f350edbfe9e8f4539cdcdb0200bd0b]
at org.neo4j.driver.internal.shaded.io.netty.handler.codec.ByteToMessageDecoder.channelInputClosed(ByteToMessageDecoder.java:377) ~[neo4j-java-driver-1.6.3.jar:1.6.3-b33d284ef6f350edbfe9e8f4539cdcdb0200bd0b]
at org.neo4j.driver.internal.shaded.io.netty.handler.codec.ByteToMessageDecoder.channelInactive(ByteToMessageDecoder.java:342) ~[neo4j-java-driver-1.6.3.jar:1.6.3-b33d284ef6f350edbfe9e8f4539cdcdb0200bd0b]
at org.neo4j.driver.internal.shaded.io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:245) ~[neo4j-java-driver-1.6.3.jar:1.6.3-b33d284ef6f350edbfe9e8f4539cdcdb0200bd0b]
at org.neo4j.driver.internal.shaded.io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:231) ~[neo4j-java-driver-1.6.3.jar:1.6.3-b33d284ef6f350edbfe9e8f4539cdcdb0200bd0b]
at org.neo4j.driver.internal.shaded.io.netty.channel.AbstractChannelHandlerContext.fireChannelInactive(AbstractChannelHandlerContext.java:224) ~[neo4j-java-driver-1.6.3.jar:1.6.3-b33d284ef6f350edbfe9e8f4539cdcdb0200bd0b]
at org.neo4j.driver.internal.shaded.io.netty.handler.codec.ByteToMessageDecoder.channelInputClosed(ByteToMessageDecoder.java:377) ~[neo4j-java-driver-1.6.3.jar:1.6.3-b33d284ef6f350edbfe9e8f4539cdcdb0200bd0b]
at org.neo4j.driver.internal.shaded.io.netty.handler.codec.ByteToMessageDecoder.channelInactive(ByteToMessageDecoder.java:342) ~[neo4j-java-driver-1.6.3.jar:1.6.3-b33d284ef6f350edbfe9e8f4539cdcdb0200bd0b]
at org.neo4j.driver.internal.shaded.io.netty.handler.ssl.SslHandler.channelInactive(SslHandler.java:1010) ~[neo4j-java-driver-1.6.3.jar:1.6.3-b33d284ef6f350edbfe9e8f4539cdcdb0200bd0b]
at org.neo4j.driver.internal.shaded.io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:245) ~[neo4j-java-driver-1.6.3.jar:1.6.3-b33d284ef6f350edbfe9e8f4539cdcdb0200bd0b]
at org.neo4j.driver.internal.shaded.io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:231) ~[neo4j-java-driver-1.6.3.jar:1.6.3-b33d284ef6f350edbfe9e8f4539cdcdb0200bd0b]
at org.neo4j.driver.internal.shaded.io.netty.channel.AbstractChannelHandlerContext.fireChannelInactive(AbstractChannelHandlerContext.java:224) ~[neo4j-java-driver-1.6.3.jar:1.6.3-b33d284ef6f350edbfe9e8f4539cdcdb0200bd0b]
at org.neo4j.driver.internal.shaded.io.netty.channel.DefaultChannelPipeline$HeadContext.channelInactive(DefaultChannelPipeline.java:1409) ~[neo4j-java-driver-1.6.3.jar:1.6.3-b33d284ef6f350edbfe9e8f4539cdcdb0200bd0b]
at org.neo4j.driver.internal.shaded.io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:245) ~[neo4j-java-driver-1.6.3.jar:1.6.3-b33d284ef6f350edbfe9e8f4539cdcdb0200bd0b]
at org.neo4j.driver.internal.shaded.io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:231) ~[neo4j-java-driver-1.6.3.jar:1.6.3-b33d284ef6f350edbfe9e8f4539cdcdb0200bd0b]
at org.neo4j.driver.internal.shaded.io.netty.channel.DefaultChannelPipeline.fireChannelInactive(DefaultChannelPipeline.java:927) ~[neo4j-java-driver-1.6.3.jar:1.6.3-b33d284ef6f350edbfe9e8f4539cdcdb0200bd0b]
at org.neo4j.driver.internal.shaded.io.netty.channel.AbstractChannel$AbstractUnsafe$8.run(AbstractChannel.java:822) ~[neo4j-java-driver-1.6.3.jar:1.6.3-b33d284ef6f350edbfe9e8f4539cdcdb0200bd0b]
at org.neo4j.driver.internal.shaded.io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163) ~[neo4j-java-driver-1.6.3.jar:1.6.3-b33d284ef6f350edbfe9e8f4539cdcdb0200bd0b]
at org.neo4j.driver.internal.shaded.io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:404) ~[neo4j-java-driver-1.6.3.jar:1.6.3-b33d284ef6f350edbfe9e8f4539cdcdb0200bd0b]
at org.neo4j.driver.internal.shaded.io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:463) ~[neo4j-java-driver-1.6.3.jar:1.6.3-b33d284ef6f350edbfe9e8f4539cdcdb0200bd0b]
at org.neo4j.driver.internal.shaded.io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:886) ~[neo4j-java-driver-1.6.3.jar:1.6.3-b33d284ef6f350edbfe9e8f4539cdcdb0200bd0b]
at org.neo4j.driver.internal.shaded.io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[neo4j-java-driver-1.6.3.jar:1.6.3-b33d284ef6f350edbfe9e8f4539cdcdb0200bd0b]
at java.lang.Thread.run(Thread.java:844) [?:?]
Сервер приложений и сервер Neo4j работаютна той же машине, поэтому предположение об ошибке в отношении "нестабильности сети" я считаю вводящим в заблуждение.
В чем причина внезапной потери соединения базы данных с Neo4j, после того, как все работает отлично в течение нескольких часов?Как я могу исправить неконтролируемое и жесткое завершение работы сервера Neo4j?