-
Notifications
You must be signed in to change notification settings - Fork 137
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 when stopping and starting connection [reconnect] #86
Comments
Basically, to support reconnection you will need to create a new connection each time when its disconnected(for example, network connection change, moving app to background and move back to foreground). |
@Narek1994 - Could you capture and attach logs? |
I will try, but could you please say do we need that DispatchGroup? I have removed it and seems, everything works well, now I am afraid that maybe there is any special need to put that DispatchGroup there. |
I remember I added the dispatch group for a specific reason. I will look
into it in a few days and will see if we can get away without the dispatch
group.
…On Tue, Jan 21, 2020 at 12:21 AM Narek1994 ***@***.***> wrote:
I will try, but could you please say do we need that DispatchGroup? I have
removed it and seems, everything works well, now I am afraid that maybe
there is any special need to put that DispatchGroup there.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#86?email_source=notifications&email_token=AAK7JJG5BTQEQY55MLZ4N3LQ62WBJA5CNFSM4KIURBO2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJO4AHY#issuecomment-576569375>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAK7JJGKUHLS3XK5N5VSIGLQ62WBJANCNFSM4KIURBOQ>
.
|
here are the logs |
We are experiencing the same issue. We do not reuse |
These are the logs until the deadlock:
|
Would a temporary solution be to call |
I think it will not help.
…On Thu, Feb 13, 2020 at 7:38 AM Damiaan Twelker ***@***.***> wrote:
Would a temporary solution be to call stop on a different thread than the
main thread?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#86?email_source=notifications&email_token=AAK7JJCW6TY4TT4TO4GLAHDRCVSQJA5CNFSM4KIURBO2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOELVOTVQ#issuecomment-585820630>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAK7JJDRSTA4NCAMTBD4L6DRCVSQJANCNFSM4KIURBOQ>
.
|
Hi @datwelk, for about month I am testing the version where I have removed DispatchGroup wait and it seems everything works well. It is a little bit hard to find out why we need that DispatchGroup(enter, leave). |
Looks like it does and it makes sense also. It currently makes you wait on the main thread, which blocks the main thread and causes it to never finish. |
Hi @Narek1994 & @moozzyk, we have tested our work-around (calling |
The @datwelk - is my understanding is that you are not on the reconnect branch and you just stop a connection, create a new instance and start? If so, this is unexpected - separate connection instances should not be interfering. |
For @datwelk's issue after looking at his logs I am wondering if the client is not running into a problem similar to //github.com/tidwall/SwiftWebSocket/issues/114. Looking at the logs there is only one log entry from the webSocket transport:
There is no other log entries even though |
@datwelk - I created #91 for your issue because I think the root cause is different than what @Narek1994 reported |
#91 is now fixed in master. As expected, it did not fix the hang happening when restarting the connection. |
@Narek1994 - I finally had some time to investigate the restart issue. Looking at the bugs I found I am not quite sure how you were even able to restart the connection once. I think the bugs made it impossible to restart the connection at all. This makes me wonder how your restart code actually looks like. If you care to share it would be helpful - maybe there are more bugs I did not find. Just in case here is a test case where I stop and restart the same connection 5 time that would constantly fail before my fixes: SignalR-Client-Swift/Tests/SignalRClientTests/HubConnectionTests.swift Lines 981 to 1008 in 39c0e60
|
Reconnect is now released in 0.7.0. Any new issues should be tracking separately. |
Hi, is it unexpected to create multiple hubConnection instance? I have multiple widgets which creates it's own hub, and start/stop connection related to appearance on screen. |
It depends. Do you have multiple hubs or just one? Do you run multiple connections at the same time or just one? Is there any reason why you don't want to/can't maintain the connection open all the time? As a side note - please do not hijack unrelated issues. Create a new one if there isn't one directly related to the problem you are seeing. This particular issue has been closed as fixed. |
As per #71 (comment) there it is possible to trigger a deadlock when stopping and starting connection.
The text was updated successfully, but these errors were encountered: