Skip to content

Conversation

@mus65
Copy link
Contributor

@mus65 mus65 commented Feb 13, 2025

Currently, the host doesn't log any exception if a IHostedService or IStartupValidator service factory fails. If you use RunAsync you also have no way to log it yourself since the host has already been disposed after it returns (see also #72225).

This catches any exceptions thrown by the GetService calls and logs and re-throws the exception, similiarly on how it is already done for exceptions in StartAsyncetc. .

@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label Feb 13, 2025
@dotnet-policy-service
Copy link
Contributor

Tagging subscribers to this area: @dotnet/area-extensions-hosting
See info in area-owners.md if you want to be subscribed.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

@steveharter steveharter requested a review from halter73 February 14, 2025 20:15
@steveharter
Copy link
Contributor

cc @halter73 for any feedback. Thanks

Copy link
Contributor

@steveharter steveharter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes look reasonable and low-risk and will help diagnose issues with configuring the services.

@steveharter steveharter merged commit b098f24 into dotnet:main Feb 20, 2025
84 of 89 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Mar 23, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-Extensions-Hosting community-contribution Indicates that the PR has been added by a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants