sdk icon indicating copy to clipboard operation
sdk copied to clipboard

[WebToolsE2E][Aspire] Installing Aspire 8.0.1 throws an exception: Cannot access a disposed object System.Collections.Concurrent.BlockingCollection.

Open v-elenafeng opened this issue 1 year ago • 7 comments

REPRO STEPS

  • Clean machine: Win11 x64 23h2 ENU
  • Install SDK 8.0.302
  • Install Aspire 8.0.1 using commands 'dotnet workload update' and 'dotnet workload install aspire'

ACTUAL The aspire workload installed successfully but encountered an error

Unhandled exception. System.ObjectDisposedException: Cannot access a disposed object. Object name: 'System.Collections.Concurrent.BlockingCollection`1[[System.String, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]'. at Microsoft.DotNet.Installer.Windows.TimestampedFileLogger.WriteMessage(String message) at Microsoft.DotNet.Installer.Windows.TimestampedFileLogger.ProcessLogRequests(Object logPipeName)

image

v-elenafeng avatar Jun 26 '24 09:06 v-elenafeng

This issue rarely occurs, reporting it in case we miss something.

v-elenafeng avatar Jun 26 '24 09:06 v-elenafeng

Adding @marcpopMSFT @joperezr for awareness.

balachir avatar Jun 26 '24 11:06 balachir

This doesn't look to be anything aspire specific, so I think this should be transferred to the sdk repo and investigated there, as seems like something wrong with one of the workload commands.

joperezr avatar Jun 26 '24 21:06 joperezr

cc @dsplaisted @Forgind to take a look. This is 8.0.302 which is the hotfix June release we did for Razor I believe. Did this repro with 8.0.300 (as we didn't make any changes in the SDK between those builds)? Does it repro with 8.0.302?

marcpopMSFT avatar Jun 26 '24 23:06 marcpopMSFT

Looks like a race condition or similar in TimestampedFileLogger between disposing the object and writing out the messages. Since it's a timing issue, it could start occurring without any specific code changes in that area. Probably we need to add a lock in WriteMessage and Dispose. @joeloff

dsplaisted avatar Jun 27 '24 00:06 dsplaisted

@v-elenafeng can you help answer Marc's questions if possible? That might be helpful for further investigation / triage.

Did this repro with 8.0.300 (as we didn't make any changes in the SDK between those builds)? Does it repro with 8.0.303?

balachir avatar Jun 28 '24 05:06 balachir

@balachir @marcpopMSFT This issue is difficult to reproduce and we have not seen it in SDK 8.0.300 or SDK 8.0.303.

v-elenafeng avatar Jun 28 '24 11:06 v-elenafeng

Aspire 8 has been deprecated. Closing.

v-elenafeng avatar Jul 09 '25 08:07 v-elenafeng