Opened 4 years ago

Closed 3 years ago

#1432 closed defect (fixed)

I2PSnark deadlock

Reported by: dg Owned by: zzz
Priority: minor Milestone: 0.9.23
Component: apps/i2psnark Version: 0.9.17
Keywords: Cc:
Parent Tickets:

Description

I2P version: 0.9.17-0
Java version: Oracle Corporation 1.7.0_65 (OpenJDK Runtime Environment 1.7.0_65-b32)
Wrapper version: 3.5.25
Server version: 8.1.16.v20140903
Servlet version: Jasper JSP 2.1 Engine
Platform: Linux amd64 3.16.0-4-amd64
Processor: Intel model 2 (pentiummmx)
Jbigi: Locally optimized native BigInteger library loaded from file
Encoding: UTF-8
Charset: UTF-8

I noticed I2PSnark wouldn't start a torrent after I had added it, downloaded the torrent, and replaced the incomplete file with a full version I had locally (to act as a seed). The router's uptime right now is 7 days, even though this deadlock occurred yesterday. Operations, including I2PSnark, do not seem to be affected.

I have also noticed that I2PSnark won't stop instances that have been started and then stopped via /configclients if they suffered from permission errors, but that's probably for another ticket.

| Found one Java-level deadlock:
| =============================
| "RouterConsole Jetty-143700":
|   waiting to lock monitor 0x00007f65e499eba8 (object 0x00000000e8f6ce00, a org.klomp.snark.Snark),
|   which is held by "RouterConsole Jetty-143147"
| "RouterConsole Jetty-143147":
|   waiting to lock monitor 0x00007f65e4836948 (object 0x00000000e8f6cf28, a java.util.ArrayList),
|   which is held by "Snark reader from XXX"
| "Snark reader from XXX":
|   waiting to lock monitor 0x00007f65e499eba8 (object 0x00000000e8f6ce00, a org.klomp.snark.Snark),
|   which is held by "RouterConsole Jetty-143147"
| 
| Java stack information for the threads listed above:
| ===================================================
| "RouterConsole Jetty-143700":
| 	at org.klomp.snark.Snark.startTorrent(Snark.java:536)
| 	- waiting to lock <0x00000000e8f6ce00> (a org.klomp.snark.Snark)
| 	at org.klomp.snark.SnarkManager.startTorrent(SnarkManager.java:2173)
| 	at org.klomp.snark.web.I2PSnarkServlet.processRequest(I2PSnarkServlet.java:998)
| 	at org.klomp.snark.web.I2PSnarkServlet.doGetAndPost(I2PSnarkServlet.java:254)
| 	at org.klomp.snark.web.I2PSnarkServlet.doPost(I2PSnarkServlet.java:151)
| 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:755)
| 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
| 	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:684)
| 	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1496)
| 	at net.i2p.servlet.filters.XSSFilter.doFilter(XSSFilter.java:28)
| 	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1476)
| 	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:501)
| 	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)
| 	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:557)
| 	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)
| 	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1086)
| 	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:429)
| 	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)
| 	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1020)
| 	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
| 	at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:255)
| 	at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:154)
| 	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
| 	at org.eclipse.jetty.server.Server.handle(Server.java:370)
| 	at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:494)
| 	at org.eclipse.jetty.server.AbstractHttpConnection.content(AbstractHttpConnection.java:982)
| 	at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:1043)
| 	at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:865)
| 	at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:240)
| 	at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
| 	at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:696)
| 	at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:53)
| 	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
| 	at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
| 	at java.lang.Thread.run(Thread.java:745)
| "RouterConsole Jetty-143147":
| 	at org.klomp.snark.PeerCoordinator.removePeerFromPieces(PeerCoordinator.java:1116)
| 	- waiting to lock <0x00000000e8f6cf28> (a java.util.ArrayList)
| 	at org.klomp.snark.PeerCoordinator.halt(PeerCoordinator.java:438)
| 	at org.klomp.snark.Snark.stopTorrent(Snark.java:621)
| 	- locked <0x00000000e8f6ce00> (a org.klomp.snark.Snark)
| 	at org.klomp.snark.Snark.stopTorrent(Snark.java:606)
| 	at org.klomp.snark.SnarkManager.stopTorrent(SnarkManager.java:1801)
| 	at org.klomp.snark.web.I2PSnarkServlet.processRequest(I2PSnarkServlet.java:987)
| 	at org.klomp.snark.web.I2PSnarkServlet.doGetAndPost(I2PSnarkServlet.java:254)
| 	at org.klomp.snark.web.I2PSnarkServlet.doPost(I2PSnarkServlet.java:151)
| 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:755)
| 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
| 	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:684)
| 	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1496)
| 	at net.i2p.servlet.filters.XSSFilter.doFilter(XSSFilter.java:28)
| 	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1476)
| 	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:501)
| 	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)
| 	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:557)
| 	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)
| 	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1086)
| 	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:429)
| 	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)
| 	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1020)
| 	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
| 	at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:255)
| 	at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:154)
| 	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
| 	at org.eclipse.jetty.server.Server.handle(Server.java:370)
| 	at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:494)
| 	at org.eclipse.jetty.server.AbstractHttpConnection.content(AbstractHttpConnection.java:982)
| 	at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:1043)
| 	at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:865)
| 	at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:240)
| 	at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
| 	at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:696)
| 	at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:53)
| 	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
| 	at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
| 	at java.lang.Thread.run(Thread.java:745)
| "Snark reader from XXX":
| 	at org.klomp.snark.Snark.stopTorrent(Snark.java:615)
| 	- waiting to lock <0x00000000e8f6ce00> (a org.klomp.snark.Snark)
| 	at org.klomp.snark.Snark.stopTorrent(Snark.java:606)
| 	at org.klomp.snark.PeerCoordinator.gotPiece(PeerCoordinator.java:1016)
| 	- locked <0x00000000e8f6cf28> (a java.util.ArrayList)
| 	at org.klomp.snark.PeerState.pieceMessage(PeerState.java:316)
| 	at org.klomp.snark.PeerConnectionIn.run(PeerConnectionIn.java:154)
| 	at org.klomp.snark.Peer.runConnection(Peer.java:304)
| 	at org.klomp.snark.PeerCoordinator$1.run(PeerCoordinator.java:600)
| 	at java.lang.Thread.run(Thread.java:745)
| 	at net.i2p.util.I2PThread.run(I2PThread.java:84)
| 
| Found 1 deadlock.
| 
| Heap
|  def new generation   total 115200K, used 83361K [0x00000000dca00000, 0x00000000e4700000, 0x00000000e4f50000)
|   eden space 102400K,  74% used [0x00000000dca00000, 0x00000000e14794f8, 0x00000000e2e00000)
|   from space 12800K,  55% used [0x00000000e2e00000, 0x00000000e34ef1d0, 0x00000000e3a80000)
|   to   space 12800K,   0% used [0x00000000e3a80000, 0x00000000e3a80000, 0x00000000e4700000)
|  tenured generation   total 255776K, used 147855K [0x00000000e4f50000, 0x00000000f4918000, 0x00000000f5a00000)
|    the space 255776K,  57% used [0x00000000e4f50000, 0x00000000edfb3fa8, 0x00000000edfb4000, 0x00000000f4918000)
|  compacting perm gen  total 32448K, used 32396K [0x00000000f5a00000, 0x00000000f79b0000, 0x0000000100000000)
|    the space 32448K,  99% used [0x00000000f5a00000, 0x00000000f79a33e8, 0x00000000f79a3400, 0x00000000f79b0000)
| No shared spaces configured.
| 
| CRIT  [uterWatchdog] 2p.router.tasks.RouterWatchdog: Router appears hung, or there is severe network congestion.  Watchdog starts barking!
| CRIT  [uterWatchdog] et.i2p.router.tasks.ThreadDump: Threads dumped to wrapper log

Subtickets

Change History (2)

comment:1 Changed 4 years ago by zzz

  • Status changed from new to accepted

thanks, a new one and a good one

comment:2 Changed 3 years ago by zzz

  • Milestone changed from 0.9.18 to 0.9.23
  • Resolution set to fixed
  • Status changed from accepted to closed

In 281eafdc7448cc75ee007e4da49c2e96fc666a92 to be 0.9.22-18

Note: See TracTickets for help on using tickets.