microsoft / microsoft/aspire

ObjectDisposedException in Dcp.KubernetesService.EnsureKubernetesAsync

Open
#8,028 2 comments 0 reactions 0 assignees View on GitHub
area-app-model
Dominant language
C#
Stars
6.3k
Forks
991
Avg merge
2d 15h
Merged PRs (30d)
196

Description

Seen in a failing test log, this suggests perhaps a missing catch.
```
2025-03-12T01:16:46.6713435Z ##[error]System.TimeoutException : The operation at /_/tests/Aspire.Hosting.Tests/Health/ResourceHealthCheckServiceTests.cs:360 timed out after reaching the limit of 5000ms.
2025-03-12T01:16:46.6715294Z
2025-03-12T01:16:46.6715493Z dbug: Aspire.Hosting.Dcp.KubernetesService[0]
2025-03-12T01:16:46.6716290Z Successfully read Kubernetes configuration from '/tmp/aspire.FytYGX/kubeconfig' after 5009 milliseconds.
2025-03-12T01:16:46.6717292Z dbug: Aspire.Hosting.Dcp.DcpExecutor[0]
2025-03-12T01:16:46.6717888Z Application orchestrator could not be stopped programmatically.
2025-03-12T01:16:46.6718606Z System.ObjectDisposedException: Cannot access a disposed object.
2025-03-12T01:16:46.6719365Z Object name: 'System.Threading.SemaphoreSlim'.
2025-03-12T01:16:46.6720065Z at System.Threading.SemaphoreSlim.Release(Int32 releaseCount)
2025-03-12T01:16:46.6721384Z at Aspire.Hosting.Dcp.KubernetesService.EnsureKubernetesAsync(CancellationToken cancellationToken) in /_/src/Aspire.Hosting/Dcp/KubernetesService.cs:line 566
2025-03-12T01:16:46.6723194Z at Aspire.Hosting.Dcp.KubernetesService.<>c__DisplayClass28_0`1.<b__0>d.MoveNext() in /_/src/Aspire.Hosting/Dcp/KubernetesService.cs:line 439
2025-03-12T01:16:46.6724335Z --- End of stack trace from previous location ---
2025-03-12T01:16:46.6724998Z at Polly.ResiliencePipeline.<>c__10`1.<b__10_0>d.MoveNext()
2025-03-12T01:16:46.6725692Z --- End of stack trace from previous location ---
2025-03-12T01:16:46.6726204Z at Polly.Outcome`1.GetResultOrRethrow()
2025-03-12T01:16:46.6727266Z at Polly.ResiliencePipeline.ExecuteAsync[TResult](Func`2 callback, CancellationToken cancellationToken)
2025-03-12T01:16:46.6729402Z at Aspire.Hosting.Dcp.KubernetesService.ExecuteWithRetry[TResult](DcpApiOperationType operationType, String resourceType, Func`2 operation, Func`2 isRetryable, CancellationToken cancellationToken) in /_/src/Aspire.Hosting/Dcp/KubernetesService.cs:line 437
2025-03-12T01:16:46.6731660Z at Aspire.Hosting.Dcp.KubernetesService.CleanupResourcesAsync(CancellationToken cancellationToken) in /_/src/Aspire.Hosting/Dcp/KubernetesService.cs:line 348
2025-03-12T01:16:46.6733232Z at Aspire.Hosting.Dcp.DcpExecutor.StopAsync(CancellationToken cancellationToken) in /_/src/Aspire.Hosting/Dcp/DcpExecutor.cs:line 180
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.