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

Kestrel reloadable config #19376

Closed
Tratcher opened this issue Feb 26, 2020 · 1 comment
Closed

Kestrel reloadable config #19376

Tratcher opened this issue Feb 26, 2020 · 1 comment
Assignees
Labels
area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions Done This issue has been fixed enhancement This issue represents an ask for new feature or an enhancement to an existing one feature-kestrel

Comments

@Tratcher
Copy link
Member

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

It's common for an application to add, remove, or reconfigure endpoints via config. That works today for Kestrel but it requires restarting the application to pick up the changes.

For reference, HttpSys supports live adding or removing endpoints in code, but not in config.

public HttpSysOptions ServerOptions { get; set; }
public void Configure(IApplicationBuilder app)
{
var addresses = ServerOptions.UrlPrefixes;
addresses.Add("http://localhost:12346/pathBase/");
app.Use(async (context, next) =>
{
// Note: To add any prefix other than localhost you must run this sample as an administrator.
var toAdd = context.Request.Query["add"];
if (!string.IsNullOrEmpty(toAdd))
{
context.Response.ContentType = "text/html";
await context.Response.WriteAsync("<html><body>");
try
{
addresses.Add(toAdd);

Describe the solution you'd like

Have Kestrel's custom configuration binder register for config reload notifications. On config change it would need to diff the changes and update its endpoints. Removing an endpoint should also cause existing connections for that endpoint to gracefully drain and close.

@Tratcher Tratcher added enhancement This issue represents an ask for new feature or an enhancement to an existing one area-servers feature-kestrel labels Feb 26, 2020
@analogrelay analogrelay added this to the 5.0.0 milestone Feb 26, 2020
@rynowak
Copy link
Member

rynowak commented Feb 27, 2020

One challenge with this is likely going to be coordinating changes to an endpoint data source (routing) along with the request draining. ie - you need to wait for all of the requests to drain before before allowing routing to process updates.

@halter73 halter73 modified the milestones: 5.0.0, 5.0.0-preview4 Apr 6, 2020
@halter73 halter73 closed this as completed May 5, 2020
@halter73 halter73 added Done This issue has been fixed and removed Working labels May 5, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Jun 4, 2020
@amcasey amcasey added the area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions label Jun 2, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions Done This issue has been fixed enhancement This issue represents an ask for new feature or an enhancement to an existing one feature-kestrel
Projects
None yet
Development

No branches or pull requests

5 participants