aspire icon indicating copy to clipboard operation
aspire copied to clipboard

Getting "context deadline exceeded" in preview 7 for large app

Open rmja opened this issue 9 months ago • 3 comments

I am getting "context deadline exceeded" when running a large app with about 20 projects with the debugger attached: image

The state in the dashboard for the projects that time out is simply "Failed to start".

Using aspire preview 7 This may be related to https://github.com/dotnet/aspire/issues/3435

Output from dotnet --info:

.NET SDK:
 Version:           8.0.300-preview.24203.14
 Commit:            b7e38f457d
 Workload version:  8.0.300-manifests.888fe647
 MSBuild version:   17.10.0+4f6b1bb28

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.22621
 OS Platform: Windows
 RID:         win-x64
 Base Path:   C:\Program Files\dotnet\sdk\8.0.300-preview.24203.14\

.NET workloads installed:
 [aspire]
   Installation Source: SDK 8.0.300-preview.24203, VS 17.10.34902.84
   Manifest Version:    8.0.0-preview.7.24251.11/8.0.100
   Manifest Path:       C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.aspire\8.0.0-preview.7.24251.11\WorkloadManifest.json
   Install Type:        FileBased


Host:
  Version:      8.0.4
  Architecture: x64
  Commit:       2d7eea2529

.NET SDKs installed:
  6.0.418 [C:\Program Files\dotnet\sdk]
  8.0.204 [C:\Program Files\dotnet\sdk]
  8.0.300-preview.24203.14 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 6.0.26 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.29 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 7.0.18 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 8.0.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 8.0.4 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 6.0.26 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.29 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 7.0.18 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 8.0.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 8.0.4 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 6.0.26 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 6.0.29 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 7.0.18 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 8.0.2 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 8.0.4 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Other architectures found:
  x86   [C:\Program Files (x86)\dotnet]
    registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]

Environment variables:
  Not set

global.json file:
  Not found

Learn more:
  https://aka.ms/dotnet/info

Download .NET:
  https://aka.ms/dotnet/download

Output from dotnet workload list:

Installed Workload Id      Manifest Version                      Installation Source
-------------------------------------------------------------------------------------------------------------
aspire                     8.0.0-preview.7.24251.11/8.0.100      SDK 8.0.300-preview.24203, VS 17.10.34902.84

Using VS 17.10.0 Preview 7

I have tried to defer as much initialization as possible in the individual projects so that they can start as fast as possible, yet I still get the timeout. It seems as if it is always the last projects that times out, and the number of projects that times out varies from run to run. It could seem as if the timeout time is computed from starting the first project, leaving the last projects to be started in the faith of the first ones being fast.

It should be noted that the the aspire host app runs fine when the debugger is not attached, where the individual projects start up much faster.

rmja avatar May 08 '24 06:05 rmja

@rmja the timeout for the project startup is now 30 seconds, but it can be extended further by setting DCP_IDE_REQUEST_TIMEOUT_SECONDS environment variable. If you set it to something like 180 (3 minutes), does the problem go away?

karolz-ms avatar May 08 '24 16:05 karolz-ms

Thanks @karolz-ms, it works with the extended timeout! I can close the issue from here as I do not experience it anymore, yet I still believe that the timeout somehow probably should be computed based on the number of projects in the host-app.

rmja avatar May 10 '24 08:05 rmja

The timeout is per project. However, after discussing with @karolz-ms , perhaps we may try to bump the timeout as well as give a better error message when we hit this timeout that includes the variable to set.

dbreshears avatar May 13 '24 18:05 dbreshears

We've increased the default timeout to 2 minutes and added a more helpful error message in the event of a timeout that informs users they can override the value of DCP_IDE_REQUEST_TIMEOUT_SECONDS.

danegsta avatar May 29 '24 21:05 danegsta