Skip to content
This repository was archived by the owner on Mar 19, 2019. It is now read-only.

Add a timeout for draining requests on shutdown #300

Merged
merged 1 commit into from
Jan 24, 2017
Merged

Conversation

Tratcher
Copy link
Member

#298
Using the same option name and default as Kestrel.

@Tratcher Tratcher added this to the 2.0.0 milestone Jan 24, 2017
@Tratcher Tratcher self-assigned this Jan 24, 2017
@@ -88,6 +88,30 @@ public class ServerTests
}

[ConditionalFact]
Copy link
Contributor

Choose a reason for hiding this comment

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

Unrelated to the change itself, but these are conditional upon nothing. Change to Fact.

Copy link
Member Author

Choose a reason for hiding this comment

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

@@ -88,6 +88,30 @@ public class ServerTests
}

[ConditionalFact]
public async Task Server_ShutdownDurringLongRunningRequest_TimesOut()
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: Durring => During

responseTask = SendRequestAsync(address);
Assert.True(received.WaitOne(TimeSpan.FromSeconds(10)));
}
Assert.False(shutdown.HasValue);
Copy link
Contributor

Choose a reason for hiding this comment

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

Check the logs written and make sure there's one request outstanding?

Copy link
Member

Choose a reason for hiding this comment

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

Logs? eww

Copy link
Member Author

Choose a reason for hiding this comment

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

redundant. I know there's an outstanding request because of received and shutdown

@@ -88,6 +88,30 @@ public class ServerTests
}

[ConditionalFact]
public async Task Server_ShutdownDurringLongRunningRequest_TimesOut()
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: During

}
Assert.False(shutdown.HasValue);
waitForShutdown.Set();
await Assert.ThrowsAsync<HttpRequestException>(async () => await responseTask);
Copy link
Contributor

Choose a reason for hiding this comment

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

Are there any specific things you can check in the exception to make sure it failed for the right reason?

Copy link
Member Author

Choose a reason for hiding this comment

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

Not consistently across net451 and core.

@@ -81,6 +81,12 @@ public long RequestQueueLimit
}
}

/// <summary>
/// The amount of time to wait for active requests to drain while the server is shutting down.
/// New requests will receive a 503 response in this time period. The default is 5 seconds.
Copy link
Contributor

Choose a reason for hiding this comment

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

I think the default info should be in <remarks>.

Copy link
Member Author

Choose a reason for hiding this comment

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

remarks looks like it's for extended discussion. summary is for IntelliSense. The comment is short enough we don't need to split it.

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 does Kestrel use remarks so much?

Copy link
Contributor

Choose a reason for hiding this comment

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

Sounds good.

@Tratcher Tratcher merged commit 56bd85a into dev Jan 24, 2017
@Tratcher Tratcher deleted the tratcher/shutdown branch January 24, 2017 22:49
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants