-
Notifications
You must be signed in to change notification settings - Fork 38.7k
test: indexes, fix on error infinite loop #28044
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
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ReviewsSee the guideline for information on the review process.
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update. |
maflcko
left a comment
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.
lgtm
98fa44c to
4b40531
Compare
|
Nice, thank you. lgtm ACK 4b405318d4c476351cccc30588f9126edd94cc35 |
|
Can be tested on current master with: diff --git a/src/index/base.cpp b/src/index/base.cpp
index cf07cae286..2987eeb97b 100644
--- a/src/index/base.cpp
+++ b/src/index/base.cpp
@@ -234,6 +234,7 @@ void BaseIndex::ThreadSync()
__func__, pindex->GetBlockHash().ToString());
return;
}
+ return FatalErrorf("foobar");
}
}
Result on master: Result with this pull applied, immediate crash: |
ryanofsky
left a comment
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.
Code review ACK 4b405318d4c476351cccc30588f9126edd94cc35
As index sync failures trigger a shutdown request without notifying BaseIndex::BlockUntilSyncedToCurrentChain in any way, we also need to check whether a shutdown was requested or not inside 'IndexWaitSynced'. Otherwise, any error inside the index sync process will hang the test forever.
4b40531 to
89ba890
Compare
|
Updated comment per feedback. Thanks ryanofsky. |
jamesob
left a comment
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.
ACK 89ba890
Built/tested locally. Seems like a commonsense way to assert-fail instead of causing an infinite loop on CI machines.
|
lgtm ACK 89ba890 |
ryanofsky
left a comment
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.
Code review ACK 89ba890. Just comment update since last review
89ba890 test: indexes, fix on error infinite loop (furszy) Pull request description: Coming from bitcoin#28036 (comment), I thought that we were going to fix it there but seems that got merged without it for some reason. As index sync failures trigger a shutdown request without notifying `BaseIndex::BlockUntilSyncedToCurrentChain` in any way, we also need to check whether a shutdown was requested or not inside 'IndexWaitSynced'. Otherwise, any error inside the index sync process will hang the test forever. ACKs for top commit: MarcoFalke: lgtm ACK 89ba890 jamesob: ACK 89ba890 ryanofsky: Code review ACK 89ba890. Just comment update since last review Tree-SHA512: 1f6daf34e51d3fbc802799bfa4ac0ef0d8f774db5f9e2f5d35df18a77679778475c94efc3da1fb723ebaf3583e4075e4a5cbe4a5104ad0c50e2b32076e247b29
Coming from #28036 (comment), I thought that we were going to fix it there but seems that got merged without it for some reason.
As index sync failures trigger a shutdown request without notifying
BaseIndex::BlockUntilSyncedToCurrentChainin any way, we also need to check whether a shutdown was requested or not inside 'IndexWaitSynced'.Otherwise, any error inside the index sync process will hang the test forever.