-
Notifications
You must be signed in to change notification settings - Fork 67
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
Deadlock in GA_login_user
if network disconnected (multi-sig wallet)
#175
Comments
Hi @pavel-kokolemin is it possible for you to reproduce this? If so, could you pastebin the complete set of thread stacks? This could be a locking issue in autobahn, I need to see where the other competing thread is at to diagnose. in gdb, |
Hi @jgriffiths |
Many thanks @pavel-kokolemin I'll see if I can debug from the call stacks. |
@jgriffiths I'm attaching the full call stacks when GDK hangs.
So I called
I'm calling GDK from a single thread. |
It seems that you are attempting to reconnect from the same thread that has received a disconnect notification. From the gdk docs for
If you wish to reconnect automatically on disconnect, you should poke another (non-notification handling) thread from your notification handler to perform this operation. |
Hi @jgriffiths
|
Sorry for the delay. Agreed that in fact the notification handler is not calling back out from gdk so this should not be deadlocking. I will investigate this weekend to try to reproduce it and hope to get back to you soon. |
I tried one of the latest commits (
Maybe using |
Hi @pavel-kokolemin, Its possible that the network is dying while the subscription is being made, and that is not handled well under macs. It should be possible to wait and loop for subscriptions to complete in this case, checking the underlying connection as we do for standard RPC calls. I'll create a branch for testing and ping here when its available. |
@pavel-kokolemin please try https://github.com/Blockstream/gdk/tree/wait_subscribe - its not production ready but it should tell us if the approach fixes your issue. |
No deadlocks so far.
And when I opened the Macbook, everything worked fine. |
@pavel-kokolemin great news, thanks. The We are about to release 0.70.1 later today; I will create a 0.70.2 pre-release with the cleaned up fix for you to test further, and when you are happy with it will release 0.70.2 officially, probably early next week. |
Hi @pavel-kokolemin can you please test with https://github.com/Blockstream/gdk/tree/wait_subscribe_reworked? This should fix the unlock error you were previously seeing. |
I started the app from the new branch 3 days ago and everything is working as expected so far, no more unlock errors and no deadlocks. Thank you very much! |
Fantastic stuff, thanks @pavel-kokolemin We will release this as part of gdk release 0.70.2 very shortly. I'll close this issue, please reopen or create another if you encounter any further problems, thanks. |
I got a deadlock in
GA_login_user
if network is disconnected in the middle of the login process (multi-sig wallet).I called
GA_login_user
and some short time later I received a notification (in different thread) that the network connection is down:but
GA_login_user
never returned.Here is the relevant stack trace:
This happend on macOS arm64 GDK build (commit
edacc118176d157597062272dc7bb6ea4ba01afc
).The text was updated successfully, but these errors were encountered: