You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 28, 2021. It is now read-only.
I've run into a case where Aleth gets stuck while syncing mainnet - it looks like the Client thread work loop (Client::doWork) stops executing due to a network exception which prevents the block queue from being drained. The network thread continues to run so Aleth continues to communicate with peers, but the Client thread gets stuck waiting on a condition variable to be signaled so syncing stops. Details:
A network exception occurs and blocks stop being imported: Full console output
INFO 11-16 01:12:27 eth client 89 blocks imported in 4747 ms (18.7471 blocks/s) in #475327
INFO 11-16 01:12:28 eth client 80 blocks imported in 1495 ms (53.4824 blocks/s) in #475407
INFO 11-16 01:12:34 eth client 72 blocks imported in 5411 ms (13.3044 blocks/s) in #475479
INFO 11-16 01:12:36 eth client 64 blocks imported in 2410 ms (26.55 blocks/s) in #475543
INFO 11-16 01:12:36 eth client 57 blocks imported in 446 ms (127.52 blocks/s) in #475600
INFO 11-16 01:12:38 eth client 63 blocks imported in 1613 ms (39.0494 blocks/s) in #475663
INFO 11-16 01:12:40 eth client 56 blocks imported in 1773 ms (31.576 blocks/s) in #475719
WARN 11-16 01:12:40 eth warn Exception thrown in Worker thread: C:\Users\nilse\Documents\Code\aleth\libethereum\EthereumCapability.cpp(1008): Throw in function class dev::eth::EthereumPeer &__cdecl dev::eth::EthereumCapability::peer(const class dev::FixedHash<64> &)
Dynamic exception type: struct boost::wrapexcept<struct dev::eth::PeerDisconnected>
[struct dev::tag_nodeID * __ptr64] = a2da42b4ad7b9f909f2789ca71a360964edb3ac6dfb2a5ecac8e7539fcae2380be6a8574792aacaf13acad1a144b518330b956f9fa18e4d165b89c13247d73fc
WARN 11-16 01:12:40 p2p ethcap Peer ##59c6f40b… causing an exception: C:\Users\nilse\Documents\Code\aleth\libethereum\EthereumCapability.cpp(1008): Throw in function class dev::eth::EthereumPeer &__cdecl dev::eth::EthereumCapability::peer(const class dev::FixedHash<64> &)
Dynamic exception type: struct boost::wrapexcept<struct dev::eth::PeerDisconnected>
[struct dev::tag_nodeID * __ptr64] = a2da42b4ad7b9f909f2789ca71a360964edb3ac6dfb2a5ecac8e7539fcae2380be6a8574792aacaf13acad1a144b518330b956f9fa18e4d165b89c13247d73fc
[ [ [ [ 0x8A99, 0xBA43B7400, 0x15F90, 0xE72717AE0D6792286968449ABA7D469BCAE1D957, 0x135F01152ED82000, 0x0, 0x1B, 0xD9C2671C69A3FD7012FB342114D0A3EA680C95CA7ED977BC6B4093CEC9A94D9F, 0x22F43D412E8275ED0E50E052A39FE9157D74BEC5719F5B72547BBF0781AF3822 ] ], [ [ ...
...
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 0x6FFCBA74720, 0x8C9E5, 0x2FEFD8, 0x5208, 0x5650C80A, 0xD783010400844765746887676F312E352E31856C696E7578, 0x432C1E7449F710DEE9CE0663EFCE8978EA13419435419B8BF38A55781452BB9F, 0x1B5834F6A490F8C2 ] ] ] ]
WARN 11-16 01:12:41 p2p warn Exception on peer destruction: C:\Users\nilse\Documents\Code\aleth\libethereum\EthereumCapability.cpp(1008): Throw in function class dev::eth::EthereumPeer &__cdecl dev::eth::EthereumCapability::peer(const class dev::FixedHash<64> &)
Dynamic exception type: struct boost::wrapexcept<struct dev::eth::PeerDisconnected>
[struct dev::tag_nodeID * __ptr64] = a2da42b4ad7b9f909f2789ca71a360964edb3ac6dfb2a5ecac8e7539fcae2380be6a8574792aacaf13acad1a144b518330b956f9fa18e4d165b89c13247d73fc
INFO 11-16 01:12:44 p2p net Active peer count: 4
INFO 11-16 01:12:44 p2p net Looking for peers...
INFO 11-16 01:13:14 p2p net Active peer count: 4
INFO 11-16 01:13:14 p2p net Looking for peers...
INFO 11-16 01:13:44 p2p net Active peer count: 4
INFO 11-16 01:13:44 p2p net Looking for peers...
INFO 11-16 01:14:14 p2p net Active peer count: 4
INFO 11-16 01:14:14 p2p net Looking for peers...
INFO 11-16 01:14:44 p2p net Active peer count: 4
INFO 11-16 01:14:44 p2p net Looking for peers...
INFO 11-16 01:15:15 p2p net Active peer count: 4
INFO 11-16 01:15:15 p2p net Looking for peers...
INFO 11-16 01:15:45 p2p net Active peer count: 5
INFO 11-16 01:15:45 p2p net Looking for peers...
INFO 11-16 01:16:15 p2p net Active peer count: 5
INFO 11-16 01:16:15 p2p net Looking for peers...
INFO 11-16 01:16:45 p2p net Active peer count: 5
INFO 11-16 01:16:45 p2p net Looking for peers...
INFO 11-16 01:17:15 p2p net Active peer count: 5
INFO 11-16 01:17:15 p2p net Looking for peers...
INFO 11-16 01:17:45 p2p net Active peer count: 5
INFO 11-16 01:17:45 p2p net Looking for peers...
INFO 11-16 01:18:15 p2p net Active peer count: 5
INFO 11-16 01:18:15 p2p net Looking for peers...
INFO 11-16 01:18:45 p2p net Active peer count: 5
Looking at the thread stacks, I don't see Client code in any of them but I do see the network thread (so it isn't the one that's paused) and I see a worker thread waiting on a condition variable:
Looking at the worker thread code in the stack, it looks like an exception can cause the worker thread to stop executing (note the condition variable wait on line 72):
I've run into a case where Aleth gets stuck while syncing mainnet - it looks like the Client thread work loop (
Client::doWork) stops executing due to a network exception which prevents the block queue from being drained. The network thread continues to run so Aleth continues to communicate with peers, but the Client thread gets stuck waiting on a condition variable to be signaled so syncing stops. Details:Full console output
aleth/libdevcore/Worker.cpp
Lines 43 to 73 in 403dc90
I suspect the thread waiting on the condition variable is the Client thread since I also set a bp in
Client::doWorkand it wasn't executed.I need to determine where the Client can call into code which calls
EthereumCapability::peer.