Skip to content

Deadlock (when expected)

Elliot Lee edited this page Jun 27, 2024 · 1 revision

Deadlock detected error

Example logs:

2024-Jun-27 09:11:28.762541 UTC LedgerConsensus:WRN By the time we got 4BF07E84BDC1F54A2D2983EC12880803728A903E6FA7DFFE5675AF1CC6E37D9B no peers were proposing it
2024-Jun-27 09:11:28.771788 UTC LoadMonitor:WRN Job: transactionBatch run: 1603ms wait: 0ms
2024-Jun-27 09:11:28.813705 UTC LoadMonitor:WRN Job: sweep run: 2131ms wait: 0ms
2024-Jun-27 09:26:38.710963 UTC LoadManager:FTL LogicError: Deadlock detected. Deadlocked time: 892s
2024-Jun-27 09:26:38.838688 UTC LoadManager:FTL JobQueue:
{
	"job_types" :
	[

		{
			"job_type" : "clientFeeChange",
			"per_second" : 1
		},

		{
			"in_progress" : 1,
			"job_type" : "sweep"
		},

		{
			"job_type" : "untrustedValidation",
			"peak_time" : 1,
			"per_second" : 5
		},

		{
			"job_type" : "transaction",
			"peak_time" : 6,
			"per_second" : 1
		},

		{
			"avg_time" : 1,
			"job_type" : "batch",
			"peak_time" : 41,
			"per_second" : 1
		},

		{
			"avg_time" : 1,
			"job_type" : "ledgerData",
			"peak_time" : 40
		},

		{
			"avg_time" : 1,
			"job_type" : "advanceLedger",
			"peak_time" : 26
		},

		{
			"job_type" : "fetchTxnData",
			"peak_time" : 8,
			"per_second" : 9
		},

		{
			"job_type" : "trustedValidation",
			"peak_time" : 5,
			"per_second" : 1
		},

		{
			"job_type" : "trustedProposal",
			"per_second" : 2
		},

		{
			"in_progress" : 1,
			"job_type" : "heartbeat"
		},

		{
			"job_type" : "peerCommand",
			"peak_time" : 1,
			"per_second" : 103
		},

		{
			"job_type" : "processTransaction",
			"peak_time" : 4,
			"per_second" : 1
		},

		{
			"job_type" : "SyncReadNode",
			"per_second" : 2
		},

		{
			"job_type" : "AsyncReadNode",
			"per_second" : 2
		},

		{
			"job_type" : "WriteNode",
			"per_second" : 43
		}
	],
	"threads" : 6
}

Logic error: Deadlock detected2024-Jun-27 09:26:38.807462 UTC Peer:WRN [018] onReadMessage from n9KWZN68mCDgKsnY3GZdankL3YLn1F8BJNAvHvsfXJHeiTfCdDg7 at [::ffff:<IP_ADDRESS>]:51235: Operation timed out

If this occurs when you put the computer into sleep mode, then this is expected behavior. If rippled is paused and then restarted it will think it was deadlocked. "LoadManager" is a heartbeat thread checking the response time. If response time is higher than 600s - the LoadManager decides the app is deadlocked.

If it's not sleep mode, there are also known deadlocks if rippled runs with a small number of jobqueue jobs (in "tiny" mode, for example).

If it's not sleep mode and it's not "tiny", then if you can get a stack trace that would be useful. In linux, open the core in gdb, then run thread apply all bt full.