-
Notifications
You must be signed in to change notification settings - Fork 35.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bitcoin Core 0.10 freezing and disconnecting during synchronization #5851
Comments
I've also noticed this. There seems to be heavy lock contention during some of the synchronization phases. This causes e.g. RPC to react slowly. Also other peers sometimes completely time out. Not only during initial sync, but also when catching up a significant number of blocks. |
Made a little progress on finding out why the GUI hangs during intensive catch-up phases. Indeed,
It will try to get the transaction information from the wallet in This is fighting symptoms, but will lead to a more responsive UI. The root cause would be mitigated by changing Edit: another consequence is that the block number and progress in the UI is not updated, as it never manages to get the |
ActivateBestChain releases cs_main between blocks, except during a reorg,
to avoid exposing a worse state than before.
|
I think the While re-writing most parts of the The rest of |
Probably makes sense to store a copy of the best chain's tip CBlockIndex* pointer in the CWallet object, and update it through a signal mechanism. Credit/confirmation querying can then use the cached version instead of needing a lock every time |
Yes. This would be a good way. |
@MrKrzYch00 could you test if the problem still exists in the |
I will give it a try after I build myself newest commit. My latest build bases on d0a10c1 , which, I'm pretty sure, was still slowing down RPC (when I was 15h behind and run my PHP script to manually connect to selected IPs, after 3rd connection it started to response very sluggish). However to confirm loosing connections I would need to re-download block chain (I think?). Also to be 100% sure I would need to note that I have one small error when building with gcc 4.9.4 (20150630 - prerelease; windows mingw) on /leveldb/util/env_win.cc file which tells me that _beginthread is undefined until I compile the file manually while omitting D_REENTRANT. Not sure what causes it and if it could have any impact on tests being correct... btw. my build is x64, uses Ofast and AVX instruction set tuning (including all dependencies, with one exception being O3 due to Ofast failing). EDIT: when I reported this issue I was using standard mingw toolchain with default build optimization but due to linker issues on other program being compiled I was forced to change gcc versions over time. The above gcc version and altered gcc switches were used only in my latest build based on commit mentioned above... |
^ this is what happens when Bitcoin Core is checking blocks, the ping times raise a lot. My speed is ~1.5MB/s download and ~70KB/s upload (bytes). I will provide more detailed text log with php script I'm running to get current height, num of connections and time it took to get reply with this data from bitcoin core during first synchronization. |
Full log at: http://4my.eu/first_synchronization_log.txt Using 2GB db cache, built with: Ofast, AVX and core i7 tuning, without debug. x64 build. Started with 38 connections, dropped to 14 soon after (guess to network lag) and finally ended up with 8. So I think it's not that bad, however, response times from RPC were exceeding 60s sometimes - two commands total as seen in php script. During very high response times BitCoin Core was using 60~80% CPU (counting usage for all cores). |
@laanwj That also happens if you load an old wallet file and trigger a rescan, it will take longer than the ping message timeout and on completion all peers will have dropped you. Not an issue under any circumstance but it might explain why I've seen peers on the network not responding to messages occasionally. |
Partially addresses in #7112. Still, AddToWallet needs better lock handling. |
Running bitcoin-qt v0.11.2 I run into "Activating best chain…" with high CPU load for 20 minutes on slow machine. Not sure if relevant: I wanted to "quickly" do a transaction but 0.11.1 crashed, making a re-index necessary. I downloaded 0.11.2 meanwhile, orderly interrupted the re-index to let the latest version take over after 10% progress. It then ran into "system shutting down due to CPU@100°C" or so. Now all I get is indefinite(?) "Activating best chain". I did the kill -9 and started bitcoin-qt, only to run into this again. Also I understood that incoming transaction trigger this lock? I switched off wifi of that machine, to not get those. |
@Giszmo: mind re-testing this issue after #7112 has been merged? (compile or https://bitcoin.jonasschnelli.ch/nightlybuilds) |
@jonasschnelli sorry but I'd be glad if my primary wallet gave me back my access to my funds asap. Syncing since yesterday and without a clue why it had to re-download 8GB so far. 50% to go. If 11.3 has the fix and you can tell me how to test, I could do that with a backup or something but else, with this machine I'm a bit paranoid to get only signed software near it. |
@Giszmo: Sure. That is wise (and I would do the same). Maybe try compile bitcoin-core by yourself? It's not that hard (check the docs/ section). |
"Activating best chain..." can take a long time in some cases, see also #7038. It processes the backlog of blocks. It should always finish eventually, though. Kill -9 will only set back progress. I don't think #7112 helps here. Sure, it makes GUI-core interaction somewhat more fluid, but high CPU during initial sync is normal (lot of verification work - with |
I frequently see my node being disconnected from all peers during IBD as ProcessMessages() doesn't get a chance to run for over 20 minutes frequently. Might a solution be to take a break from UpdateTip every now and again to give some received messages some attention? |
Yes, that's still the same issue. |
fix: QT Wallet Freeze resolved. Do update Balances in QT GUI every 60 sec. Instead of every block. Description in Korean: TX 이력이 많은 Large wallet 예를들면 마이닝풀, 에서QT 밸런스를 업데이트할때 딜레이가 발생하고 5초 마다 발생하는데 딜레이가 3초이상으로 길어지면 QT지갑을 사용하기 어려워진다. 그래서 업데이트 간격을 every block 에서 12 blocks (약 60초) 간격으로 늘린다. 대신 잔액 업데이트가 1분간격으로 이루어지며 업데이트 딜레이가 생긴다. 하지만 사용상의 딜레이로 인한 랙장애는 없다. 이 해결책은 원본 비트코인지갑의 known issue에 대한 해결책이며 workaround에 속한다. 비트코인 개발자들의 지속적인 업데이트를 주시한다. 증상: QT지갑의 잦은 랙으로 인한 사용불가 현상 (경미) 마이닝풀에서 해시가 늘어나지 않는 현상 (심각) 해결된것: QT지갑의 지연이 60초 간격으로 lockMain 주기를 완화시킴으로 해결. Ref: Bitcoin-ABC/bitcoin-abc#49 bitcoin/bitcoin#10504 bitcoin/bitcoin#15148 bitcoin/bitcoin#10349 bitcoin/bitcoin#5851 bitcoin/bitcoin#13612
fix: QT Wallet Freeze resolved. Do update Balances in QT GUI every 60 sec. Instead of every blocks. Description in Korean: TX 이력이 많은 Large wallet 예를들면 마이닝풀, 에서QT지갑의 잔액 상황을 보여줄때 딜레이가 발생하고 이것은 5초 마다 발생하는데 이 딜레이 셧다운이 3초이상으로 길어지면 거의 계속 멈춘상태로 QT지갑을 사용하기 어려워진다. 그래서 업데이트 간격을 every block 에서 12 blocks (약 60초) 간격으로 늘린다. 대신 잔액 업데이트가 1분간격으로 이루어지며 딜레이로 인한 랙장애는 없다. 참고로 비트코인은 10분에 1회 이루어 진다. 이 해결책은 원본 비트코인지갑의 known issue에 대한 해결책이며 workaround에 속한다. 비트코인 개발자들의 지속적인 업데이트를 주시한다. 증상: QT지갑의 잦은 랙으로 인한 사용불가 현상 (경미) 마이닝풀에서 해시가 늘어나지 않는 현상 (심각) 해결된것: QT지갑의 지연이 60초 간격으로 lockMain 주기를 완화시킴으로 해결. Ref: Bitcoin-ABC/bitcoin-abc#49 bitcoin/bitcoin#10504 bitcoin/bitcoin#15148 bitcoin/bitcoin#10349 bitcoin/bitcoin#5851 bitcoin/bitcoin#13612
fix: QT Wallet Freeze resolved. Do update Balances in QT GUI every 60 sec. Instead of every blocks. Description in Korean: TX 이력이 많은 Large wallet 예를들면 마이닝풀, 에서QT지갑의 잔액 상황을 보여줄때 딜레이가 발생하고 이것은 5초 마다 발생하는데 이 딜레이 셧다운이 3초이상으로 길어지면 거의 계속 멈춘상태로 QT지갑을 사용하기 어려워진다. 그래서 업데이트 간격을 every block 에서 12 blocks (약 60초) 간격으로 늘린다. 대신 잔액 업데이트가 1분간격으로 이루어지며 딜레이로 인한 랙장애는 없다. 참고로 비트코인은 10분에 1회 이루어 진다. 이 해결책은 원본 비트코인지갑의 known issue에 대한 해결책이며 workaround에 속한다. 비트코인 개발자들의 지속적인 업데이트를 주시한다. 증상: QT지갑의 잦은 랙으로 인한 사용불가 현상 (경미) 마이닝풀에서 해시가 늘어나지 않는 현상 (심각) 해결된것: QT지갑의 지연이 60초 간격으로 lockMain 주기를 완화시킴으로 해결. Ref: Bitcoin-ABC/bitcoin-abc#49 bitcoin/bitcoin#10504 bitcoin/bitcoin#15148 bitcoin/bitcoin#10349 bitcoin/bitcoin#5851 bitcoin/bitcoin#13612
fix: QT Wallet Freeze resolved. Do update Balances in QT GUI every 60 sec. Instead of every blocks. Description in Korean: TX 이력이 많은 Large wallet 예를들면 마이닝풀, 에서QT지갑의 잔액 상황을 보여줄때 딜레이가 발생하고 이것은 5초 마다 발생하는데 이 딜레이 셧다운이 3초이상으로 길어지면 거의 계속 멈춘상태로 QT지갑을 사용하기 어려워진다. 그래서 업데이트 간격을 every block 에서 12 blocks (약 60초) 간격으로 늘린다. 대신 잔액 업데이트가 1분간격으로 이루어지며 딜레이로 인한 랙장애는 없다. 참고로 비트코인은 10분에 1회 이루어 진다. 이 해결책은 원본 비트코인지갑의 known issue에 대한 해결책이며 workaround에 속한다. 비트코인 개발자들의 지속적인 업데이트를 주시한다. 증상: QT지갑의 잦은 랙으로 인한 사용불가 현상 (경미) 마이닝풀에서 해시가 늘어나지 않는 현상 (심각) 해결된것: QT지갑의 지연이 60초 간격으로 lockMain 주기를 완화시킴으로 해결. Ref: Bitcoin-ABC/bitcoin-abc#49 bitcoin/bitcoin#10504 bitcoin/bitcoin#15148 bitcoin/bitcoin#10349 bitcoin/bitcoin#5851 bitcoin/bitcoin#13612
fix: QT Wallet Freeze resolved. Do update Balances in QT GUI every 60 sec. Instead of every blocks. Description in Korean: TX 이력이 많은 Large wallet 예를들면 마이닝풀, 에서QT지갑의 잔액 상황을 보여줄때 딜레이가 발생하고 이것은 5초 마다 발생하는데 이 딜레이 셧다운이 3초이상으로 길어지면 거의 계속 멈춘상태로 QT지갑을 사용하기 어려워진다. 그래서 업데이트 간격을 every block 에서 12 blocks (약 60초) 간격으로 늘린다. 대신 잔액 업데이트가 1분간격으로 이루어지며 딜레이로 인한 랙장애는 없다. 참고로 비트코인은 10분에 1회 이루어 진다. 이 해결책은 원본 비트코인지갑의 known issue에 대한 해결책이며 workaround에 속한다. 비트코인 개발자들의 지속적인 업데이트를 주시한다. 증상: QT지갑의 잦은 랙으로 인한 사용불가 현상 (경미) 마이닝풀에서 해시가 늘어나지 않는 현상 (심각) 해결된것: QT지갑의 지연이 60초 간격으로 lockMain 주기를 완화시킴으로 해결. Ref: Bitcoin-ABC/bitcoin-abc#49 bitcoin/bitcoin#10504 bitcoin/bitcoin#15148 bitcoin/bitcoin#10349 bitcoin/bitcoin#5851 bitcoin/bitcoin#13612
fix: QT Wallet Freeze resolved. Do update Balances in QT GUI every 60 sec. Instead of every blocks. Description in Korean: TX 이력이 많은 Large wallet 예를들면 마이닝풀, 에서QT지갑의 잔액 상황을 보여줄때 딜레이가 발생하고 이것은 5초 마다 발생하는데 이 딜레이 셧다운이 3초이상으로 길어지면 거의 계속 멈춘상태로 QT지갑을 사용하기 어려워진다. 그래서 업데이트 간격을 every block 에서 12 blocks (약 60초) 간격으로 늘린다. 대신 잔액 업데이트가 1분간격으로 이루어지며 딜레이로 인한 랙장애는 없다. 참고로 비트코인은 10분에 1회 이루어 진다. 이 해결책은 원본 비트코인지갑의 known issue에 대한 해결책이며 workaround에 속한다. 비트코인 개발자들의 지속적인 업데이트를 주시한다. 증상: QT지갑의 잦은 랙으로 인한 사용불가 현상 (경미) 마이닝풀에서 해시가 늘어나지 않는 현상 (심각) 해결된것: QT지갑의 지연이 60초 간격으로 lockMain 주기를 완화시킴으로 해결. Ref: Bitcoin-ABC/bitcoin-abc#49 bitcoin/bitcoin#10504 bitcoin/bitcoin#15148 bitcoin/bitcoin#10349 bitcoin/bitcoin#5851 bitcoin/bitcoin#13612
Background:
Problem:
Bitcoin Core 0.10 is constantly freezing during synchronization, especially on newer blocks losing connections and making RPC unresponsive. This happens when Bitcoin Core uses more than one thread to analyse downloaded blocks (occurs more often when the height is higher - uses more threads then).
Expencted Results:
GUI and RPC server should still response to user inputs or at least should not lose connections to other Bitcoin peers.
The text was updated successfully, but these errors were encountered: