Opened 4 years ago

Closed 3 years ago

#1722 closed defect (fixed)

Deadlock

Reported by: zzz Owned by:
Priority: major Milestone: 0.9.24
Component: router/general Version: 0.9.23
Keywords: Cc:
Parent Tickets: Sensitive: no

Subtickets

Change History (4)

comment:1 Changed 4 years ago by zzz

Timer thread holds the Router lock (_routerInfoLock) at Router.java:813 while rebuilding the router info which ends up trying to reserve the FloodSearchJob?'s monitor at FloodSearchJob?.java:72

SimpleTimer2 1/4: Blocked, 906ms CPU, B/W: 31/229660; Locked by net.i2p.router.networkdb.kademlia.IterativeSearchJob@6fb73035/JobQueue 2/5
net.i2p.router.networkdb.kademlia.FloodSearchJob.addDeferred(FloodSearchJob.java:72)
net.i2p.router.networkdb.kademlia.FloodfillNetworkDatabaseFacade.search(FloodfillNetworkDatabaseFacade.java:369)
net.i2p.router.networkdb.kademlia.FloodfillNetworkDatabaseFacade.search(FloodfillNetworkDatabaseFacade.java:329)
net.i2p.router.networkdb.kademlia.FloodfillNetworkDatabaseFacade.lookupBeforeDropping(FloodfillNetworkDatabaseFacade.java:507)
net.i2p.router.networkdb.kademlia.KademliaNetworkDatabaseFacade.fail(KademliaNetworkDatabaseFacade.java:1097)
net.i2p.router.networkdb.kademlia.KademliaNetworkDatabaseFacade.lookupRouterInfoLocally(KademliaNetworkDatabaseFacade.java:625)
net.i2p.router.transport.udp.IntroductionManager.pickInbound(IntroductionManager.java:184)
net.i2p.router.transport.udp.UDPTransport.locked_rebuildExternalAddress(UDPTransport.java:1978)
net.i2p.router.transport.udp.UDPTransport.rebuildExternalAddress(UDPTransport.java:1950)
net.i2p.router.transport.udp.UDPTransport.rebuildExternalAddress(UDPTransport.java:1916)
net.i2p.router.transport.udp.UDPTransport.updateAddress(UDPTransport.java:1866)
net.i2p.router.transport.TransportManager.getAddresses(TransportManager.java:466)
net.i2p.router.transport.CommSystemFacadeImpl.createAddresses(CommSystemFacadeImpl.java:212)
net.i2p.router.Router.locked_rebuildRouterInfo(Router.java:835)
net.i2p.router.Router.rebuildRouterInfo(Router.java:813)
net.i2p.router.Router.rebuildRouterInfo(Router.java:802)
net.i2p.router.transport.udp.UDPTransport.locked_rebuildExternalAddress(UDPTransport.java:2060)
net.i2p.router.transport.udp.UDPTransport.rebuildExternalAddress(UDPTransport.java:1950)
net.i2p.router.transport.udp.UDPTransport.rebuildExternalAddress(UDPTransport.java:1916)
net.i2p.router.transport.udp.UDPTransport.rebuildExternalAddress(UDPTransport.java:1878)
net.i2p.router.transport.udp.UDPTransport.rebuildIfNecessary(UDPTransport.java:1473)
net.i2p.router.transport.udp.UDPTransport.dropPeer(UDPTransport.java:1418)
net.i2p.router.transport.udp.UDPTransport$ExpirePeerEvent.timeReached(UDPTransport.java:2869)
net.i2p.util.SimpleTimer2$TimedEvent.run2(SimpleTimer2.java:468)
net.i2p.util.SimpleTimer2$TimedEvent.run(SimpleTimer2.java:412)
java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
java.util.concurrent.FutureTask.run(Unknown Source)
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(Unknown Source)
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
java.lang.Thread.run(Unknown Source)

JobQueue? thread holds the IterativeSearchJob? (FloodSearchJob?) monitor at line IterativeSearchJob?.java:205 when getting the router hash which attempts to obtain the Router lock (_routerInfoLock) at line Router.java:492

JobQueue 2/5: Blocked, 276078ms CPU, B/W: 17942/112805; Locked by java.lang.Object@34dd6594/SimpleTimer2 1/4
net.i2p.router.Router.getRouterInfo(Router.java:492)
net.i2p.router.RouterContext.routerHash(RouterContext.java:269)
net.i2p.router.networkdb.kademlia.IterativeSearchJob.runJob(IterativeSearchJob.java:205)
net.i2p.router.JobQueueRunner.runCurrentJob(JobQueueRunner.java:135)
net.i2p.router.JobQueueRunner.run(JobQueueRunner.java:78) 
Last edited 4 years ago by zzz (previous) (diff)

comment:2 Changed 4 years ago by zzz

Resolution: fixed
Status: newclosed

Caused by zab sync changes in ISJ in 0.9.23
Fixed in 0.9.23-8 67517db1fbbe3b7b17d01cdea84f3468bbe8ab28
Warnings added to methods in Router and RouterContext? as we've had multiple similar deadlocks via those methods before

comment:3 Changed 4 years ago by zzz

Resolution: fixed
Status: closedreopened

More in 24f4d6663de894774fc067aa4ff9c4245ac25e48 0.9.23-12

reopening to look further

comment:4 Changed 3 years ago by zzz

Priority: blockermajor
Resolution: fixed
Status: reopenedclosed

Optimistically closing.

Note: See TracTickets for help on using tickets.