Skip to content

Conversation

@fjahr
Copy link
Contributor

@fjahr fjahr commented Sep 5, 2020

Fixes #19853

I investigated the issue in #19876 and I still intend to fix the underlying issue of a race when using wallet RPCs right after starting a node in that PR. However, since that is a bit more complicated than I initially thought it makes sense to merge the fix of the test so the intermittent test failures stop. This fix in the test is going to be needed, either way, #19876 will only provide an error where before it was reporting a false balance.

Co-authored-by: João Barbosa <joao.paulo.barbosa@gmail.com>
@promag
Copy link
Contributor

promag commented Sep 5, 2020

ACK

@maflcko
Copy link
Member

maflcko commented Sep 6, 2020

Can you explain what is going on here?

  • Does the wallet submit txs to the mempool, which do not get marked as in the mempool? This seems like a bug, as the wallet should mark them as soon as they are submitted.

  • Or, it seems the issue is that the wallet waits for the mempool to be loaded, in which case the txs in the wallet are only marked as in-mempool when they went through the validationinterfacequeue? In that case it could make sense to fixup the comment wait until the wallet has submitted all transacti... to wait until the mempool is loaded. (I added the wrong comment, but this pull is somewhat related, so could fix up the comment in one go)

@maflcko
Copy link
Member

maflcko commented Sep 6, 2020

Maybe it is a race where either the wallet or the (load)mempool may add the tx?

The syncwithvalidationinterfacequeue seems like a nice temporary workaround, but ideally the wallet would properly start up/block before responding to RPCs. Maybe the BlockUntilSynced... should also block until the wallet has imported all mempool txs on start-up/loadwallet?

@fjahr
Copy link
Contributor Author

fjahr commented Sep 6, 2020

@MarcoFalke Thanks for these hints! I am still working on fixing the actual issue in #19876. But since it's taking a bit longer to investigate and it's in dispute if this actually needs fixing, I decided to open this fix to the intermittent CI failures since they seem to occur pretty frequently. If the fix for the underlying issue is showing a better error this line will be needed anyway, if the fix makes the issue go away completely I will remove it again with #19876. So it may or may not be temporary, either way, I am just trying to mitigate the CI issue as fast as possible.

@maflcko
Copy link
Member

maflcko commented Sep 6, 2020

Having a balance, then restarting bitcoin core and having a different balance would be a bug that needs proper fixing.

ACK either way on the temporary test workaround, but maybe it could say that it is only temporary?

@maflcko maflcko merged commit c91f955 into bitcoin:master Sep 6, 2020
@promag
Copy link
Contributor

promag commented Sep 6, 2020

Having a balance, then restarting bitcoin core and having a different balance would be a bug

Is this what's going on?

@maflcko
Copy link
Member

maflcko commented Sep 6, 2020

Yes, I believe so. At least the balance is less than it should be otherwise the amount wouldn't be out of range (i.e. negative) later on, no?

@promag
Copy link
Contributor

promag commented Sep 17, 2020

@MarcoFalke missed this comment. I'll
image

PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Jul 1, 2021
56b018c test: Fix flaky wallet_basic test (Fabian Jahr)

Pull request description:

  Fixes bitcoin#19853

  I investigated the issue in bitcoin#19876 and I still intend to fix the underlying issue of a race when using wallet RPCs right after starting a node in that PR. However, since that is a bit more complicated than I initially thought it makes sense to merge the fix of the test so the intermittent test failures stop. This fix in the test is going to be needed, either way, bitcoin#19876 will only provide an error where before it was reporting a false balance.

Top commit has no ACKs.

Tree-SHA512: 52bb2388a3e77aa20d26ab0fd45796bc1781483b1cffe49cbb44e2488a72e76998edfb1198495373f9c6fd2ec26064d4176bd1a64dd59806622d5e50a4f4e870
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Jul 16, 2021
56b018c test: Fix flaky wallet_basic test (Fabian Jahr)

Pull request description:

  Fixes bitcoin#19853

  I investigated the issue in bitcoin#19876 and I still intend to fix the underlying issue of a race when using wallet RPCs right after starting a node in that PR. However, since that is a bit more complicated than I initially thought it makes sense to merge the fix of the test so the intermittent test failures stop. This fix in the test is going to be needed, either way, bitcoin#19876 will only provide an error where before it was reporting a false balance.

Top commit has no ACKs.

Tree-SHA512: 52bb2388a3e77aa20d26ab0fd45796bc1781483b1cffe49cbb44e2488a72e76998edfb1198495373f9c6fd2ec26064d4176bd1a64dd59806622d5e50a4f4e870
Fabcien pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this pull request Sep 23, 2021
Summary:
> I investigated the issue in [[bitcoin/bitcoin#19876 | core#19876]] and I still intend to fix the underlying issue of a race when using wallet RPCs right after starting a node in that PR. However, since that is a bit more complicated than I initially thought it makes sense to merge the fix of the test so the intermittent test failures stop. This fix in the test is going to be needed, either way, #19876 will only provide an error where before it was reporting a false balance

Co-authored-by: João Barbosa <joao.paulo.barbosa@gmail.com>

This is a backport of [[bitcoin/bitcoin#19887 | core#19887]]

Test Plan: `ninja check-functional`

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D10183
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Feb 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

random wallet_basic failure

4 participants