AkioNak
commented at 2:36 am on December 11, 2018:
contributor
wallet_multiwallet.py --usecli may sometimes fails with
“Duplicate -wallet filename specified”
unloadwallet() RPC command just notify the unload intention
and it may delay a little bit until actual unloading.
This patch check the completion of unloading by using listwallets().
The wallet itself has locks to prevent it from being loaded while already loaded, so it seems like an OK fix to me.
promag
commented at 12:04 pm on December 11, 2018:
member
@kallewoof that’s what happening, it hits that error.
It’s always the case that after unloadwallet Xlistwallets doesn’t return X but that wallet can be unloading. This change only reduces the race to the actual duplicate condition.
I see 4 solutions:
add an option to unloadwallet to force waiting 👍 👍
use this change but also change listwallets to actually verify if the wallet is not unloaded 👎
make loadwallet aware the wallet is unloading and wait for it 👍
change the test to repeat the loadwallet until it succeeds 👍 👍 👍 👍
make loadwallet aware the wallet is unloading and wait for it
@ryanofsky what are your thoughts?
ryanofsky
commented at 4:42 pm on December 12, 2018:
member
make loadwallet aware the wallet is unloading and wait for it
I think a better approach would be to make unloadwallet aware that a wallet is unloading and wait for it. It’s surprising to me that this would be an asynchronous operation.
promag
commented at 6:46 pm on December 12, 2018:
member
@ryanofsky the idea was to not block especially if the wallet is being used or a rescan is going on. In that case the client could timeout and then the problem would be the same — attempt to load would raise Duplicate -wallet filename specified error. But maybe we should ignore these edge cases and make it synchronous or even add an option?
MarcoFalke
commented at 6:54 pm on December 12, 2018:
member
Agree with @ryanofsky. Seems unnecessary to make this call async. If the wallet is in use (e.g. rescan) you should be aware of it and not call unloadwallet. So shouldn’t unloadwallet throw an error in that case?
wallet_multiwallet.py --usecli may sometimes fails with
"Duplicate -wallet filename specified"
Unloadwallet RPC command just notify the unload intention
and it may delay a little bit until actual unloading.
This patch make loadwallet to retry if JSONRPCException occurs.
52b380b5bd
AkioNak force-pushed
on Dec 13, 2018
laanwj
commented at 1:48 pm on December 13, 2018:
member
kallewoof
commented at 10:23 pm on December 13, 2018:
member
@laanwj Please do not close PR:s unless there is inactivity or the author is clearly not cooperating. The authors are perfectly capable of doing this themselves.
laanwj
commented at 10:27 pm on December 13, 2018:
member
@kallewoof I don’t think there’s a point of having multiple competing PRs open, this spreads discussion around, reopening is always a possibility if discussion goes the other way
kallewoof
commented at 11:22 pm on December 13, 2018:
member
I understand your desire to have a clean list of PRs, but there really is no rush on the matter. This PR literally had pushes to it hours before you closed it. If the author judges that the replacement is objectively better they will close their PR on their own, and if they refuse, I see no problem with you making a judgement call like this one.
laanwj
commented at 8:58 am on December 14, 2018:
member
I’m not sure how you’re interpreting it, but for me, closing the PR is only an indication that it’s currently not considered for merging. It doesn’t delete the discussion, doesn’t even prevent replying! it doesn’t delete the code changes, etc.
That’s a typical maintainer task. at least for me it has nothing to do with ‘urgency’ or capability or non-capability of the author to do it themselves.
But anyhow if you insist I’ll re-open.
laanwj reopened this
on Dec 14, 2018
kallewoof
commented at 9:24 am on December 14, 2018:
member
Removing my comment as it strays off topic from the PR. I’ve sent it to @laanwj in private.
promag
commented at 10:01 am on December 14, 2018:
member
@kallewoof I don’t think it makes sense to change the test tree to later revert. There is already agreement to change unloadwallet and @laanwj just closed this in light of that - being closed doesn’t mean is locked and dead.
laanwj
commented at 10:05 am on December 14, 2018:
member
Yes, so I think there’s a misunderstanding here:
Thanks @AkioNak for trying to fix the test!
However your PR made us realize that the current unloadwallet behavior is broken in the first place and that the unload shouldn’t be asynchronous, and the test failure is pointing out an actual issue. It likely means that the test doesn’t need to change.
AkioNak
commented at 11:17 am on December 14, 2018:
contributor
@kallewoof@promag@ryanofsky@MarcoFalke@laanwj Thank you so much.
Now I understand that we need to fix the behaviour of unloadwallet rather than changing the test.
So, I close this PR myself.
AkioNak closed this
on Dec 14, 2018
promag
commented at 11:29 am on December 14, 2018:
member
Thank you @AkioNak for identifying the problem so quick.
laanwj referenced this in commit
91dbba8857
on Jan 10, 2019
AkioNak deleted the branch
on Jan 11, 2019
laanwj referenced this in commit
1b6fc30530
on Jan 15, 2019
PastaPastaPasta referenced this in commit
39308f017a
on Sep 8, 2021
vijaydasmp referenced this in commit
70a1f2c79b
on Sep 13, 2021
This is a metadata mirror of the GitHub repository
bitcoin/bitcoin.
This site is not affiliated with GitHub.
Content is generated from a GitHub metadata backup.
generated: 2024-12-18 21:12 UTC
This site is hosted by @0xB10C More mirrored repositories can be found on mirror.b10c.me