Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an IChangeToken to IServerAddressesFeature #21246

Open
halter73 opened this issue Apr 27, 2020 · 8 comments
Open

Add an IChangeToken to IServerAddressesFeature #21246

halter73 opened this issue Apr 27, 2020 · 8 comments
Labels
affected-few This issue impacts only small number of customers api-suggestion Early API idea and discussion, it is NOT ready for implementation area-hosting Includes Hosting area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions enhancement This issue represents an ask for new feature or an enhancement to an existing one severity-minor This label is used by an internal tool
Milestone

Comments

@halter73
Copy link
Member

Is your feature request related to a problem? Please describe.

This is a followup to #19376. HttpSys and now Kestrel both support reconfiguring endpoints at runtime. When an endpoint is added or removed, the IServerAddressesFeature is updated to reflect this changes. Unfortunately there is no way to observe when the IServerAddressesFeature changes today.

Describe the solution you'd like

We should add an IChangeToken to IServerAddressesFeature so app developers can have a way to react to server endpoint reconfiguration.

@halter73 halter73 added area-hosting api-suggestion Early API idea and discussion, it is NOT ready for implementation labels Apr 27, 2020
@analogrelay
Copy link
Contributor

Or just a CancellationToken. As part of the extensions migration we had a discussion about change tokens and while we can't justify removing them, it's probably not necessary to keep them. Unless we need to compose with one from config (which I guess we might have to)

@Tratcher
Copy link
Member

CancellationTokens don't have convetions for firing multiple times, which we would need here.

@analogrelay
Copy link
Contributor

I seem to remember we had discussed ways to handle that. Adding @stephentoub and @davidfowl

Regardless of that, I'm supportive of the general idea (signalling changes to addresses). We just need to figure out the right primitive to use.

@davidfowl
Copy link
Member

I wouldn’t stop using IChangeToken as yet. I’d hate to bring inconsistency here especially since the config system already exposes it. Either we expose an event or an IChangeToken

@analogrelay
Copy link
Contributor

Fair enough. Just wanted to raise the issue.

@analogrelay analogrelay added this to the Backlog milestone May 1, 2020
@analogrelay
Copy link
Contributor

Triage: Backlogging until we have a motivating scenario (from customer, YARP, etc.)

@analogrelay
Copy link
Contributor

One example of a change that might be needed here: HttpsRedirectionMiddleware only reads IServerAddressesFeature once. If it changes, the middleware will need to know to re-read it.

@Tratcher Tratcher added affected-few This issue impacts only small number of customers enhancement This issue represents an ask for new feature or an enhancement to an existing one severity-minor This label is used by an internal tool labels Nov 6, 2020 — with ASP.NET Core Issue Ranking
@halter73
Copy link
Member Author

In light of my thoughts in #41737, maybe it should be a new service type that has a read-only list of addresses and an IChangeToken. This would have the additional benefit of being able to consume from application code.

@amcasey amcasey added area-hosting Includes Hosting and removed feature-hosting labels Jun 1, 2023
@amcasey amcasey added area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions and removed area-runtime labels Aug 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affected-few This issue impacts only small number of customers api-suggestion Early API idea and discussion, it is NOT ready for implementation area-hosting Includes Hosting area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions enhancement This issue represents an ask for new feature or an enhancement to an existing one severity-minor This label is used by an internal tool
Projects
None yet
Development

No branches or pull requests

6 participants