是先打印了死锁的警告然后输出Neo4j的日志,能否帮忙分析一下是什么原因导致的?
发布于 4 个月前 作者 crazyyanchao 234 次浏览 来自 问答

分布式程序更新图,客户端使用CYPHER更新图,使用了Neo4j驱动,用C3p0做了连接池,当我启动一个Server和多个Client更新图的时候爆java.nio.channels.ClosedChannelException 备注:启动了一个server,五个client,测试时四个client挂掉了爆的错一样,只有一个client是看起来正常的 爆出这个错误,是先打印了死锁的警告然后输出Neo4j的日志,能否帮忙分析一下是什么原因导致的?

2018-08-18 10:39:59[com.mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector.run(ThreadPoolAsynchronousRunner.java:807)] com.mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector@23468307 -- APPARENT DEADLOCK!!! Complete Status: 
	Managed Threads: 3
	Active Threads: 3
	Active Tasks: 
		com.mchange.v2.resourcepool.BasicResourcePool$1RefurbishCheckinResourceTask@245dbd09
			on thread: C3P0PooledConnectionPoolManager[identityToken->2rvzm09xks5pppxp14t3|79698539]-HelperThread-#2
		com.mchange.v2.resourcepool.BasicResourcePool$1RefurbishCheckinResourceTask@5655278d
			on thread: C3P0PooledConnectionPoolManager[identityToken->2rvzm09xks5pppxp14t3|79698539]-HelperThread-#1
		com.mchange.v2.resourcepool.BasicResourcePool$1RefurbishCheckinResourceTask@7bf16972
			on thread: C3P0PooledConnectionPoolManager[identityToken->2rvzm09xks5pppxp14t3|79698539]-HelperThread-#0
	Pending Tasks: 
		com.mchange.v2.resourcepool.BasicResourcePool$1RefurbishCheckinResourceTask@820b78a
		com.mchange.v2.resourcepool.BasicResourcePool$1RefurbishCheckinResourceTask@75312c94
		com.mchange.v2.resourcepool.BasicResourcePool$1RefurbishCheckinResourceTask@1dbf727a
		com.mchange.v2.resourcepool.BasicResourcePool$1RefurbishCheckinResourceTask@2dd4a7a9
		com.mchange.v2.resourcepool.BasicResourcePool$1RefurbishCheckinResourceTask@75566f4
		com.mchange.v2.resourcepool.BasicResourcePool$1RefurbishCheckinResourceTask@3777fc44
		com.mchange.v2.resourcepool.BasicResourcePool$1RefurbishCheckinResourceTask@23909b3
		com.mchange.v2.resourcepool.BasicResourcePool$1RefurbishCheckinResourceTask@628aea61
		com.mchange.v2.resourcepool.BasicResourcePool$1RefurbishCheckinResourceTask@6dd1f239
		com.mchange.v2.resourcepool.BasicResourcePool$1RefurbishCheckinResourceTask@47400608
		com.mchange.v2.resourcepool.BasicResourcePool$1RefurbishCheckinResourceTask@5857d723
		com.mchange.v2.resourcepool.BasicResourcePool$1RefurbishCheckinResourceTask@109188b4
		com.mchange.v2.resourcepool.BasicResourcePool$1RefurbishCheckinResourceTask@2cfd9b0a
		com.mchange.v2.resourcepool.BasicResourcePool$1RefurbishCheckinResourceTask@752180c4
		com.mchange.v2.resourcepool.BasicResourcePool$1RefurbishCheckinResourceTask@24ac87a
		com.mchange.v2.resourcepool.BasicResourcePool$1RefurbishCheckinResourceTask@215404a1
		com.mchange.v2.resourcepool.BasicResourcePool$1RefurbishCheckinResourceTask@6265a548
		com.mchange.v2.resourcepool.BasicResourcePool$1RefurbishCheckinResourceTask@489b7559
		com.mchange.v2.resourcepool.BasicResourcePool$1RefurbishCheckinResourceTask@39a09c0
		com.mchange.v2.resourcepool.BasicResourcePool$1RefurbishCheckinResourceTask@34f32575
		com.mchange.v2.resourcepool.BasicResourcePool$1RefurbishCheckinResourceTask@3ace65df
		com.mchange.v2.resourcepool.BasicResourcePool$1RefurbishCheckinResourceTask@2c7aba7c
		com.mchange.v2.resourcepool.BasicResourcePool$1RefurbishCheckinResourceTask@1185b0b7
		com.mchange.v2.resourcepool.BasicResourcePool$1RefurbishCheckinResourceTask@404566e7
		com.mchange.v2.resourcepool.BasicResourcePool$1RefurbishCheckinResourceTask@b0c4905
		com.mchange.v2.resourcepool.BasicResourcePool$1RefurbishCheckinResourceTask@4a9f0360
		com.mchange.v2.resourcepool.BasicResourcePool$1RefurbishCheckinResourceTask@240f712e
Pool thread stack traces:
	Thread[C3P0PooledConnectionPoolManager[identityToken->2rvzm09xks5pppxp14t3|79698539]-HelperThread-#2,5,main]
		sun.misc.Unsafe.park(Native Method)
		java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
		java.util.concurrent.FutureTask.awaitDone(FutureTask.java:429)
		java.util.concurrent.FutureTask.get(FutureTask.java:191)
		org.neo4j.jdbc.utils.TimeLimitedCodeBlock.runWithTimeout(TimeLimitedCodeBlock.java:48)
		org.neo4j.jdbc.bolt.impl.BoltNeo4jConnectionImpl.isValid(BoltNeo4jConnectionImpl.java:250)
		sun.reflect.GeneratedMethodAccessor11.invoke(Unknown Source)
		sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
		java.lang.reflect.Method.invoke(Method.java:483)
		org.neo4j.jdbc.utils.Neo4jInvocationHandler.invoke(Neo4jInvocationHandler.java:54)
		com.sun.proxy.$Proxy3.isValid(Unknown Source)
		com.mchange.v2.c3p0.impl.DefaultConnectionTester$2.activeCheckConnectionNoQuery(DefaultConnectionTester.java:136)
		com.mchange.v2.c3p0.impl.DefaultConnectionTester$3.activeCheckConnectionNoQuery(DefaultConnectionTester.java:180)
		com.mchange.v2.c3p0.impl.DefaultConnectionTester.activeCheckConnection(DefaultConnectionTester.java:275)
		com.mchange.v2.c3p0.AbstractConnectionTester.activeCheckConnection(AbstractConnectionTester.java:79)
		com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.testPooledConnection(C3P0PooledConnectionPool.java:504)
		com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.finerLoggingTestPooledConnection(C3P0PooledConnectionPool.java:452)
		com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.refurbishResourceOnCheckin(C3P0PooledConnectionPool.java:404)
		com.mchange.v2.resourcepool.BasicResourcePool.attemptRefurbishResourceOnCheckin(BasicResourcePool.java:1760)
		com.mchange.v2.resourcepool.BasicResourcePool.access$200(BasicResourcePool.java:44)
		com.mchange.v2.resourcepool.BasicResourcePool$1RefurbishCheckinResourceTask.run(BasicResourcePool.java:1378)
		com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:696)
	Thread[C3P0PooledConnectionPoolManager[identityToken->2rvzm09xks5pppxp14t3|79698539]-HelperThread-#0,5,main]
		sun.misc.Unsafe.park(Native Method)
		java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
		java.util.concurrent.FutureTask.awaitDone(FutureTask.java:429)
		java.util.concurrent.FutureTask.get(FutureTask.java:191)
		org.neo4j.jdbc.utils.TimeLimitedCodeBlock.runWithTimeout(TimeLimitedCodeBlock.java:48)
		org.neo4j.jdbc.bolt.impl.BoltNeo4jConnectionImpl.isValid(BoltNeo4jConnectionImpl.java:250)
		sun.reflect.GeneratedMethodAccessor11.invoke(Unknown Source)
		sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
		java.lang.reflect.Method.invoke(Method.java:483)
		org.neo4j.jdbc.utils.Neo4jInvocationHandler.invoke(Neo4jInvocationHandler.java:54)
		com.sun.proxy.$Proxy3.isValid(Unknown Source)
		com.mchange.v2.c3p0.impl.DefaultConnectionTester$2.activeCheckConnectionNoQuery(DefaultConnectionTester.java:136)
		com.mchange.v2.c3p0.impl.DefaultConnectionTester$3.activeCheckConnectionNoQuery(DefaultConnectionTester.java:180)
		com.mchange.v2.c3p0.impl.DefaultConnectionTester.activeCheckConnection(DefaultConnectionTester.java:275)
		com.mchange.v2.c3p0.AbstractConnectionTester.activeCheckConnection(AbstractConnectionTester.java:79)
		com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.testPooledConnection(C3P0PooledConnectionPool.java:504)
		com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.finerLoggingTestPooledConnection(C3P0PooledConnectionPool.java:452)
		com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.refurbishResourceOnCheckin(C3P0PooledConnectionPool.java:404)
		com.mchange.v2.resourcepool.BasicResourcePool.attemptRefurbishResourceOnCheckin(BasicResourcePool.java:1760)
		com.mchange.v2.resourcepool.BasicResourcePool.access$200(BasicResourcePool.java:44)
		com.mchange.v2.resourcepool.BasicResourcePool$1RefurbishCheckinResourceTask.run(BasicResourcePool.java:1378)
		com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:696)
	Thread[C3P0PooledConnectionPoolManager[identityToken->2rvzm09xks5pppxp14t3|79698539]-HelperThread-#1,5,main]
		sun.misc.Unsafe.park(Native Method)
		java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
		java.util.concurrent.FutureTask.awaitDone(FutureTask.java:429)
		java.util.concurrent.FutureTask.get(FutureTask.java:191)
		org.neo4j.jdbc.utils.TimeLimitedCodeBlock.runWithTimeout(TimeLimitedCodeBlock.java:48)
		org.neo4j.jdbc.bolt.impl.BoltNeo4jConnectionImpl.isValid(BoltNeo4jConnectionImpl.java:250)
		sun.reflect.GeneratedMethodAccessor11.invoke(Unknown Source)
		sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
		java.lang.reflect.Method.invoke(Method.java:483)
		org.neo4j.jdbc.utils.Neo4jInvocationHandler.invoke(Neo4jInvocationHandler.java:54)
		com.sun.proxy.$Proxy3.isValid(Unknown Source)
		com.mchange.v2.c3p0.impl.DefaultConnectionTester$2.activeCheckConnectionNoQuery(DefaultConnectionTester.java:136)
		com.mchange.v2.c3p0.impl.DefaultConnectionTester$3.activeCheckConnectionNoQuery(DefaultConnectionTester.java:180)
		com.mchange.v2.c3p0.impl.DefaultConnectionTester.activeCheckConnection(DefaultConnectionTester.java:275)
		com.mchange.v2.c3p0.AbstractConnectionTester.activeCheckConnection(AbstractConnectionTester.java:79)
		com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.testPooledConnection(C3P0PooledConnectionPool.java:504)
		com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.finerLoggingTestPooledConnection(C3P0PooledConnectionPool.java:452)
		com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.refurbishResourceOnCheckin(C3P0PooledConnectionPool.java:404)
		com.mchange.v2.resourcepool.BasicResourcePool.attemptRefurbishResourceOnCheckin(BasicResourcePool.java:1760)
		com.mchange.v2.resourcepool.BasicResourcePool.access$200(BasicResourcePool.java:44)
		com.mchange.v2.resourcepool.BasicResourcePool$1RefurbishCheckinResourceTask.run(BasicResourcePool.java:1378)
		com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:696)

2018-08-18 10:40:59[com.mchange.v2.async.ThreadPoolAsynchronousRunner.processReplacedThreads(ThreadPoolAsynchronousRunner.java:555)] Task com.mchange.v2.resourcepool.BasicResourcePool$1RefurbishCheckinResourceTask@245dbd09 (in deadlocked PoolThread) failed to complete in maximum time 60000ms. Trying interrupt().
2018-08-18 10:40:59[com.mchange.v2.async.ThreadPoolAsynchronousRunner.processReplacedThreads(ThreadPoolAsynchronousRunner.java:555)] Task com.mchange.v2.resourcepool.BasicResourcePool$1RefurbishCheckinResourceTask@7bf16972 (in deadlocked PoolThread) failed to complete in maximum time 60000ms. Trying interrupt().
2018-08-18 10:40:59[com.mchange.v2.async.ThreadPoolAsynchronousRunner.processReplacedThreads(ThreadPoolAsynchronousRunner.java:555)] Task com.mchange.v2.resourcepool.BasicResourcePool$1RefurbishCheckinResourceTask@5655278d (in deadlocked PoolThread) failed to complete in maximum time 60000ms. Trying interrupt().
八月 18, 2018 10:40:59 上午 org.neo4j.driver.internal.logging.JULogger error
严重: [727298531] TLS socket could not be closed cleanly
java.nio.channels.ClosedChannelException
	at sun.nio.ch.SocketChannelImpl.ensureWriteOpen(SocketChannelImpl.java:269)
	at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:460)
	at org.neo4j.driver.internal.security.TLSSocketChannel.channelWrite(TLSSocketChannel.java:193)
	at org.neo4j.driver.internal.security.TLSSocketChannel.close(TLSSocketChannel.java:481)
	at org.neo4j.driver.internal.net.SocketClient.stop(SocketClient.java:212)
	at org.neo4j.driver.internal.net.SocketConnection.close(SocketConnection.java:265)
	at org.neo4j.driver.internal.net.ConcurrencyGuardingConnection.close(ConcurrencyGuardingConnection.java:178)
	at org.neo4j.driver.internal.net.pooling.PooledSocketConnection.dispose(PooledSocketConnection.java:251)
	at org.neo4j.driver.internal.net.pooling.BlockingPooledConnectionQueue.disposeSafely(BlockingPooledConnectionQueue.java:167)
	at org.neo4j.driver.internal.net.pooling.BlockingPooledConnectionQueue.disposeBroken(BlockingPooledConnectionQueue.java:120)
	at org.neo4j.driver.internal.net.pooling.PooledConnectionReleaseConsumer.accept(PooledConnectionReleaseConsumer.java:50)
	at org.neo4j.driver.internal.net.pooling.PooledConnectionReleaseConsumer.accept(PooledConnectionReleaseConsumer.java:29)
	at org.neo4j.driver.internal.net.pooling.PooledSocketConnection.close(PooledSocketConnection.java:200)
	at org.neo4j.driver.internal.NetworkSession.closeCurrentConnection(NetworkSession.java:375)
	at org.neo4j.driver.internal.NetworkSession.syncAndCloseCurrentConnection(NetworkSession.java:349)
	at org.neo4j.driver.internal.NetworkSession.close(NetworkSession.java:169)
	at org.neo4j.jdbc.bolt.impl.BoltNeo4jConnectionImpl.close(BoltNeo4jConnectionImpl.java:214)
	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:483)
	at org.neo4j.jdbc.utils.Neo4jInvocationHandler.invoke(Neo4jInvocationHandler.java:54)
	at com.sun.proxy.$Proxy3.close(Unknown Source)
	at com.mchange.v2.c3p0.impl.NewPooledConnection.close(NewPooledConnection.java:642)
	at com.mchange.v2.c3p0.impl.NewPooledConnection.closeMaybeCheckedOut(NewPooledConnection.java:255)
	at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.destroyResource(C3P0PooledConnectionPool.java:622)
	at com.mchange.v2.resourcepool.BasicResourcePool$1DestroyResourceTask.run(BasicResourcePool.java:1076)
	at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:696)

213131231231.png

1 回复

客户端代码是怎样的?

回到顶部