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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deadlock occurs all the time if MvxAppStart.ApplicationStartup(...) has an await #4520

Open
1 task
evgenyvalavin opened this issue Nov 16, 2022 · 2 comments
Open
1 task

Comments

@evgenyvalavin
Copy link
Contributor

evgenyvalavin commented Nov 16, 2022

馃悰 Bug Report

MvxAppStart.ApplicationStartup(...) is a virtual method returning a Task. It means anyone can override the method and add any code, including asynchronous code.
There're 6 await keywords in the MvxAppStart and no .ConfigureAwait(false) to prevent deadlocks.
I don't see why .ConfigureAwait(false) must not be added to each method with await.
I come across this deadlock over time over and over again and it always takes time to investigate.

Expected behavior

No deadlock occurs if asynchronous code with an await is added to ApplicationStartup(...)

Reproduction steps

  1. Add await Task.Delay(1_000).ConfigureAwait(false) or just await Task.Delay(1_000) to ApplicationStartup(...) to cause a deadlock.

Deadlock is caused by manually retrieving an awaiter and getting the result in
StartAsync(hint).GetAwaiter().GetResult();

Configuration

Version: 9.0.2

Platform:

  • 馃摫 iOS
@entdark
Copy link
Contributor

entdark commented Nov 16, 2022

Maybe it's actually this: #4364?

@evgenyvalavin
Copy link
Contributor Author

evgenyvalavin commented Nov 16, 2022

I don't think so. The deadlock is reproducible on MvvmCross 7.1.2.

The issue have been here since Adjusting startup behaviour commit when .ConfigureAwait(false) was missed. I believe starting from 6.2.0-beta1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants