Uh oh!
There was an error while loading. Please reload this page.
HostFactoryResolver - Increase default timeout to thirty seconds - #61621
Conversation
ghost
commented
Nov 15, 2021
Tagging subscribers to this area: @eerhardt, @maryamariyan Issue Details
|
| // The amount of time we wait for the diagnostic source events to fire | ||
| private static readonly TimeSpan s_defaultWaitTimeout = Debugger.IsAttached ? Timeout.InfiniteTimeSpan : TimeSpan.FromSeconds(5); | ||
| private static readonly TimeSpan s_defaultWaitTimeout = Debugger.IsAttached ? Timeout.InfiniteTimeSpan : TimeSpan.FromMinutes(1); |
There was a problem hiding this comment.
Assuming we improve the error message to make it clear that there was a timeout, are we worried that people will just kill the migration before seeing the error if we make this a full minute?
There was a problem hiding this comment.
updates exception messaging and changed it to 30 seconds, assuming we would keep the environment variable option.
Uh oh!
There was an error while loading. Please reload this page.
…tFactoryResolver.cs Co-authored-by: Stephen Halter <halter73@gmail.com>
davidfowl
commented
Nov 16, 2021
How did we land on 30 seconds? Just FYI, the reason the keyvault configuration provider tends to be the one that times out is because it makes an HTTP request per key, value pair to get the initial set of configuration values. The default should be like 5 minutes to just cover those scenarios. |
maryamariyan
commented
Nov 16, 2021
My thought was, since we are allowing to accept environment variables then it's fair to reduce to 30 seconds. Also because of @halter73 's comment below:
|
davidfowl
commented
Nov 16, 2021
It should be more than 30 seconds because of the keyvault scenario (if you want some concrete data, look for keyvault configuration provider issues). My vote is 5 minutes |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
…ostFactoryResolverTests.cs
…opLevelStatementsTestsTimeout/Program.cs
Customer Impact
When customer has debugger attached or when using tools like EF, host startup path using WebApplicationBuilder for hosting and WebApplicationFactory for testing, may fail to build and throw an InvalidOperationException with the message “Unable to build IHost.”, because the default timeout is only 5 seconds.
We are proposing to use a higher timeout (1 minute) to be used so that when an application is taking longer to build, we could allow startup code to complete, and the host can start successfully.
Increasing the timeout should not have a negative impact on experience.
TODO
Risk
Very low.
Regression
No, new 6.0 feature/code flow for discovering a host.
Even though this is not a regression (uses WebApplicationBuilder which is new), but since this code is in the ASP.NET Core templates, it regresses the scenario when using default templates.
Fixes#60891, dotnet/aspnetcore#33886