The timeout was unlimited before, so just restore that value for now: #27988 (comment) .
(Strictly speaking, this is a behavior change for the blockfilterindex and txindex tests, because it only restores the coinstatsindex behavior.)
The timeout was unlimited before, so just restore that value for now: #27988 (comment) .
(Strictly speaking, this is a behavior change for the blockfilterindex and txindex tests, because it only restores the coinstatsindex behavior.)
The timeout was unlimited before, so just restore that value for now:
https://github.com/bitcoin/bitcoin/pull/27988#issuecomment-1619218007
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
See 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.
Reviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.
ACK fabed7eb
I’m a bit more inclined for #28026 but it is fine either way.
Note: Would be good to mention in the PR description that this is a behavior change for the blockfilterindex and txindex tests. It only restores the coinstatsindex behavior.
m_synced
flag is never set by the thread. I’m not sure how the CI will behave in this scenario, guess that we will realize that something like this happened just by reading the last executed test name.
m_synced
flag to true. Which would make BlockUntilSyncedToCurrentChain
never return true. Which could happen on all the index sync errors.
utACK fabed7eb796637c02e3677ebbe183d90b258ba69
Could also restore the original behaviour by doing something like:
0void IndexWaitSynced(BaseIndex& index, std::chrono::microseconds timeout)
1{
2 const auto end = SteadyClock::now() + timeout;
3 while (!index.BlockUntilSyncedToCurrentChain()) {
4 Assert(timeout <= 0s || SteadyClock::now < end);
5 UninterruptibleSleep(100ms);
6 }
7}
and calling IndexWaitSynced(index, 10s)
normally, but IndexWaitSynced(index, -1s)
for coinstatsindex.
ACK fabed7eb796637c02e3677ebbe183d90b258ba69
as per #28026#pullrequestreview-1514862606 I like this approach more than running the sync synchronously.
Could also restore the original behaviour by doing something like:
The problem in the first place was that that the tests for txindex and blockfilterindex would have rare intermittent timeouts. So instead of making guesses about the slowest environment the tests could be run in I think it’s ok to just have no timeout.
Which could happen on all the index sync errors.
Good point. Though, that seems like a bigger problem of the unit tests not handling AbortNode/FatalError/StartShutdown at all?
Which could happen on all the index sync errors.
Good point. Though, that seems like a bigger problem of the unit tests not handling AbortNode/FatalError/StartShutdown at all?
The quickest fix would be to add a ShutdownRequested()
call into the IndexWaitSynced()
loop. And verify at the end of the function that the index class is synced by calling:
0BOOST_CHECK(index.GetSummary().synced);
In this way, we can be guarded against the infinite loop. And also verify the index synchronization result (which must be always successful).
The “AbortNode/FatalError/StartShutdown” treatment on the tests topic seems to be a different problem that we should aboard in the future, yeah. Here the test main thread will actively-wait for a flag to be set, and the flag could never be set. So, even if we start handling “AbortNode/FatalError/StartShutdown” on the base tests class, the error would need to be handled by a different thread (not sure if we already have something for it).