Skip to content

Conversation

@amcasey
Copy link
Member

@amcasey amcasey commented May 8, 2023

If it is called again and nothing has changed, it should do nothing.

Part of #45801

If it is called again and nothing has changed, it should do nothing.

Part of dotnet#45801
// Any endpoints that were removed from the last time endpoints were loaded are returned.
internal (List<ListenOptions>, List<ListenOptions>) Reload()
{
_reloadToken = Configuration.GetReloadToken();
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
_reloadToken = Configuration.GetReloadToken();
_reloadToken = ReloadOnChange ? Configuration.GetReloadToken() : NullChangeToken.Singleton;

We should not grab the token on load if KestrelConfigurationLoader.ReloadOnChange is false. That's what the is DoesNotReloadOnConfigurationChangeByDefault test is about. Normally it's true if you have a "default" host like WebApplication.

You'll need to add using Microsoft.Extensions.FileProviders too. Not the best namespace there.

Copy link
Member Author

Choose a reason for hiding this comment

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

I didn't change the existing IChangeToken handling, so I believe that test is still passing. I intentionally decoupled rebind-on-change from determine-if-reloading-would-be-redundant, but I'm open to discussion.

Copy link
Member Author

Choose a reason for hiding this comment

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

Why am I pulling in Microsoft.Extensions.FileProviders?

@amcasey amcasey mentioned this pull request May 8, 2023
4 tasks
amcasey added 2 commits May 10, 2023 18:59
...so that `Load` can retain its current behavior.  Also, only consume the change token when `ReloadOnChange` is true.
Copy link
Member

@halter73 halter73 left a comment

Choose a reason for hiding this comment

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

Looks great!

@amcasey amcasey enabled auto-merge (squash) May 12, 2023 00:46
@amcasey amcasey merged commit 0625a17 into dotnet:main May 12, 2023
@ghost ghost added this to the 8.0-preview5 milestone May 12, 2023
amcasey added a commit to amcasey/aspnetcore that referenced this pull request May 12, 2023
So that configuration-based certs will be considered, if necessary.

Largely salvaged from dotnet#48056
Builds on dotnet#48137
Fixes dotnet#45801
amcasey added a commit that referenced this pull request May 17, 2023
So that configuration-based certs will be considered, if necessary.

Largely salvaged from #48056
Builds on #48137
Fixes #45801
@amcasey amcasey added area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions and removed area-runtime labels Jun 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants