Persistent Kafka getting restarted
- Dominant language
- C#
- Stars
- 6.3k
- Forks
- 991
- Avg merge
- 2d 15h
- Merged PRs (30d)
- 196
Description
### Is there an existing issue for this?
- [x] I have searched the existing issues
### Describe the bug
A Kafka dependency is restarted each time I run the AppHost project.
Minimal reproduction code:
```
var kafka = builder
.AddKafka("messaging").WithLifetime(ContainerLifetime.Persistent);
```
I am on MacOS, using Docker Desktop
Happy to provide further details as necessary
Thank you
### Expected Behavior
_No response_
### Steps To Reproduce
_No response_
### Exceptions (if any)
_No response_
### AppHost CSProj
```
Exe
net8.0
enable
enable
true
*****
```
### .NET Version info
```
dotnet --info
.NET SDK:
Version: 8.0.100
Commit: 57efcf1350
Workload version: 8.0.100-manifests.4d7d414a
Runtime Environment:
OS Name: Mac OS X
OS Version: 14.4
OS Platform: Darwin
RID: osx-arm64
Base Path: /usr/local/share/dotnet/sdk/8.0.100/
.NET workloads installed:
Workload version: 8.0.100-manifests.4d7d414a
There are no installed workloads to display.
Host:
Version: 8.0.0
Architecture: arm64
Commit: 5535e31a71
.NET SDKs installed:
8.0.100 [/usr/local/share/dotnet/sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 8.0.0 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 8.0.0 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Other architectures found:
x64 [/usr/local/share/dotnet/x64]
registered at [/etc/dotnet/install_location_x64]
Environment variables:
Not set
global.json file:
Not found
```
### Anything else?
_No response_
Contributor guide
Research direction
Start with the provided C# AppHost reproduction using AddKafka("messaging").WithLifetime(ContainerLifetime.Persistent) on macOS with Docker Desktop, and observe the Kafka container across AppHost runs. Trace the resource lifetime behavior and verify that the Kafka dependency is not restarted when the AppHost project is run again.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, docker, kafka, macos
- Domain
- devops, infrastructure
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100