Skip to content
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

Mac deadlock fix. #1377

Merged
merged 6 commits into from Apr 29, 2019

Conversation

Projects
None yet
2 participants
@molnard
Copy link
Contributor

commented Apr 26, 2019

Closes: #1363

Reproduce issue:

  1. Checkout Tag 1.1.4.
  2. Delete .walletwasabi folder (backup your wallets before doing that!).
  3. Dotnet run.
  4. Wait for the UI hangs while searching for Hardware Wallets.

Issue:

For some reason on Mac we get a deadlock randomly with this line:


According to my experience it is happening more often if the Filters are being downloaded meanwhile so there is another operation which is refreshing the UI and put some tasks to UI dispatcher. That is the reason why it is not likely to happen after the first run. After some investigation I have found that this is not an unknown issue.

http://blog.stephencleary.com/2012/12/dont-block-in-asynchronous-code.html

Solution

Seem smelly but the solution is to wrap the SetResult in a Task.Run to force it onto a separate thread. It is suggested by: Stephen Cleary.
Tried this but it did not work on mac I got the same deadlock so I used Task.Run().

@nopara73

This comment has been minimized.

Copy link
Collaborator

commented Apr 28, 2019

We shouldn't use Task.Run(). We ended up having this issue, because we had smelly code in the first place. How else could we fix it without a smell? @lontivero

molnard added some commits Apr 29, 2019

@nopara73 nopara73 merged commit e0d0a16 into zkSNACKs:master Apr 29, 2019

4 checks passed

CodeFactor No issues found.
Details
Wasabi.Linux #20190429.3 succeeded
Details
Wasabi.Osx #20190429.3 succeeded
Details
Wasabi.Windows #20190429.3 succeeded
Details

@nopara73 nopara73 referenced this pull request May 4, 2019

Closed

Mac stability #1404

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.