Resource proxy port conflict isn't reflected in resource dashboard
- 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
If a resource that has a proxy that DCP can't start because port is in use, DCP will incorrectly report that the resource is running. For example:
```cs
var s1Echo = builder
.AddContainer("s1-echo", "hashicorp/http-echo")
.WithHttpEndpoint(8080, targetPort: 5678);
s1Echo
.WithEnvironment("ECHO_TEXT", $"Hello from {s1Echo.GetEndpoint("http")}");
```
If port 8080 is in use then DCP will report the resource is running and green in the dashboard. In the background it will retry for a long time to start the proxy on 8080. Trying to access the resource using 8080 will fail. This is confusing to the user because the resource reports it is running successfully.

DCP eventually it writes an error message to the app host console:

### Expected Behavior
The resource should be in a `Starting` state until the proxy at 8080 is running. If DCP can't run the proxy then the resource should go into a `FailedToStart` state. Right now there is a very long timeout when trying to start the proxy. I think 30 seconds is probably the max we should make users wait before giving them feedback.
### Steps To Reproduce
_No response_
### Exceptions (if any)
_No response_
### .NET Version info
_No response_
### Anything else?
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.