-
Notifications
You must be signed in to change notification settings - Fork 37.8k
Fix several node initialization issues #8392
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
Conversation
I guess this does not entirely fix #8117: the main problem I was observing is that after a call with |
MilliSleep(10); | ||
{ | ||
boost::unique_lock<boost::mutex> lock(cs_GenesisWait); | ||
while (!fHaveGenesis) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not familiar with this code so I may be wrong.
However, it seems you are locking cs_GenesisWait
waiting for fHaveGenesis
to be true, while at the same time, the code responsible to make fHaveGenesis
true at https://github.com/bitcoin/bitcoin/pull/8392/files#diff-c865a8939105e6350a50af02766291b7R521 need the same cs_GenesisWait
lock. Seems deadlock ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rebased and fixed a bug in unit tests (it needed a call to ActivateBestChain as well now, since removing it from InitBlockIndex). |
Going to test this one |
It now does all the catching up at
Tried adding a yield in Adding a single 200ms sleep before In any case ACK on the changes already here. |
threadGroup.create_thread(boost::bind(&ThreadImport, vImportFiles)); | ||
|
||
// Wait for genesis block to be processed | ||
bool fHaveGenesis = false; | ||
while (!fHaveGenesis && !fRequestShutdown) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line was only just added in May by Patrick! Is the loss of sensitivity to a shutdown request intentional?
Github-Pull: bitcoin#8392 Rebased-From: 0fd2a33
Github-Pull: bitcoin#8392 Rebased-From: aa59f2e
Github-Pull: bitcoin#8392 Rebased-From: 9d4eb9a
Github-Pull: bitcoin#8392 Rebased-From: 9d4eb9a
ebbb876 Peer initialization issues, bitcoin#8392 backport (furszy) Pull request description: Upstream@[8392](bitcoin#8392) backport. ACKs for top commit: random-zebra: ACK ebbb876 Mrs-X: utACK ebbb876 Tree-SHA512: 4abe3200e5b883df925f3144e22368d48569a25364b60ae63ade9ed4d4d66da759a7b427be8460bb6999342ca3fcb4653cbe5c93fc4da7f6843fab3bb1400ce7
ebbb876740a8ed1a436ba73660b2383b24a18d6a Peer initialization issues, #8392 backport (furszy) Pull request description: Upstream@[8392](bitcoin/bitcoin#8392) backport. ACKs for top commit: random-zebra: ACK ebbb876740a8ed1a436ba73660b2383b24a18d6a Mrs-X: utACK PIVX-Project/PIVX@ebbb876 Tree-SHA512: 4abe3200e5b883df925f3144e22368d48569a25364b60ae63ade9ed4d4d66da759a7b427be8460bb6999342ca3fcb4653cbe5c93fc4da7f6843fab3bb1400ce7
banlist.dat: store banlist on disk Cherry-picked from the following upstream PRs: - bitcoin/bitcoin#6310 - bitcoin/bitcoin#6315 - Only the new signal and net changes, no QT. - bitcoin/bitcoin#7350 - bitcoin/bitcoin#7458 - bitcoin/bitcoin#7696 - bitcoin/bitcoin#7959 - bitcoin/bitcoin#7906 - Only the ban-related commits. - bitcoin/bitcoin#8392 - Only the second commit. - bitcoin/bitcoin#8085 - Only the second commit. - bitcoin/bitcoin#10564 Part of #2074.
banlist.dat: store banlist on disk Cherry-picked from the following upstream PRs: - bitcoin/bitcoin#6310 - bitcoin/bitcoin#6315 - Only the new signal and net changes, no QT. - bitcoin/bitcoin#7350 - bitcoin/bitcoin#7458 - bitcoin/bitcoin#7696 - bitcoin/bitcoin#7959 - bitcoin/bitcoin#7906 - Only the ban-related commits. - bitcoin/bitcoin#8392 - Only the second commit. - bitcoin/bitcoin#8085 - Only the second commit. - bitcoin/bitcoin#10564 Part of #2074.
banlist.dat: store banlist on disk Cherry-picked from the following upstream PRs: - bitcoin/bitcoin#6310 - bitcoin/bitcoin#6315 - Only the new signal and net changes, no QT. - bitcoin/bitcoin#7350 - bitcoin/bitcoin#7458 - bitcoin/bitcoin#7696 - bitcoin/bitcoin#7959 - bitcoin/bitcoin#7906 - Only the ban-related commits. - bitcoin/bitcoin#8392 - Only the second commit. - bitcoin/bitcoin#8085 - Only the second commit. - bitcoin/bitcoin#10564 - bitcoin/bitcoin#13061 - Wasn't needed when I first made this backport in 2017, but it is now! Part of #2074.
banlist.dat: store banlist on disk Cherry-picked from the following upstream PRs: - bitcoin/bitcoin#6310 - bitcoin/bitcoin#6315 - Only the new signal and net changes, no QT. - bitcoin/bitcoin#7350 - bitcoin/bitcoin#7458 - bitcoin/bitcoin#7696 - bitcoin/bitcoin#7959 - bitcoin/bitcoin#7906 - Only the ban-related commits. - bitcoin/bitcoin#8392 - Only the second commit. - bitcoin/bitcoin#8085 - Only the second commit. - bitcoin/bitcoin#10564 - bitcoin/bitcoin#13061 - Wasn't needed when I first made this backport in 2017, but it is now! Part of #2074.
Fixes #8117
There were several issues:
InitBlockIndex
was still callingActivateBestChain
(intended so the genesis block would be activated), which caused the full chain activate to occur immediately (before the node was fully started and RPC was enabled). Remove this, as this is dealt with during the background import thread now.If accepted, I propose that the first commit is backported to 0.13. The second needs extra translation, unfortunately.