mirror of
https://github.com/caddyserver/caddy.git
synced 2025-05-24 19:49:56 +08:00
caddyhttp: Honor grace period in background (#5043)
* caddyhttp: Honor grace period in background This avoids blocking during config reloads. * Don't quit process until servers shut down * Make tests more likely to pass on fast CI (#5045) * caddyhttp: Even faster shutdowns Simultaneously shut down all HTTP servers, rather than one at a time. In practice there usually won't be more than 1 that lingers. But this code ensures that they all Shutdown() in their own goroutine and then we wait for them at the end (if exiting). We also wait for them to start up so we can be fairly confident the shutdowns have begun; i.e. old servers no longer accepting new connections. * Fix comment typo * Pull functions out of loop, for readability
This commit is contained in:
@ -16,6 +16,7 @@ func TestRespond(t *testing.T) {
|
||||
{
|
||||
http_port 9080
|
||||
https_port 9443
|
||||
grace_period 1
|
||||
}
|
||||
|
||||
localhost:9080 {
|
||||
@ -37,6 +38,7 @@ func TestRedirect(t *testing.T) {
|
||||
{
|
||||
http_port 9080
|
||||
https_port 9443
|
||||
grace_period 1
|
||||
}
|
||||
|
||||
localhost:9080 {
|
||||
@ -86,6 +88,7 @@ func TestReadCookie(t *testing.T) {
|
||||
{
|
||||
http_port 9080
|
||||
https_port 9443
|
||||
grace_period 1
|
||||
}
|
||||
|
||||
localhost:9080 {
|
||||
@ -109,6 +112,7 @@ func TestReplIndex(t *testing.T) {
|
||||
{
|
||||
http_port 9080
|
||||
https_port 9443
|
||||
grace_period 1
|
||||
}
|
||||
|
||||
localhost:9080 {
|
||||
|
Reference in New Issue
Block a user