-
Notifications
You must be signed in to change notification settings - Fork 367
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
varnishd: always shutdown both ends to a backend
Signed-off-by: Asad Sajjad Ahmed <asadsa@varnish-software.com>
- Loading branch information
Showing
2 changed files
with
48 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
varnishtest "VCP FIN-WAIT2" | ||
|
||
server s1 { | ||
rxreq | ||
txresp | ||
|
||
# Leave the TCP connection open in the FIN-WAIT2 state | ||
delay 1000 | ||
} -start | ||
|
||
server s2 { | ||
rxreq | ||
txresp | ||
} -start | ||
|
||
varnish v1 -vcl { | ||
backend s1 { | ||
.host = "${s1_sock}"; | ||
} | ||
} -start | ||
|
||
# The waiter depend on the backend_idle_timeout for when to give up and | ||
# close the connection, so bump it up a bit. | ||
varnish v1 -cliok "param.set backend_idle_timeout 120" | ||
|
||
# The shutdown is done on the CLI thread, and it blocks until the waiter has | ||
# killed the connection. So bump cli_timeout up as well | ||
varnish v1 -cliok "param.set cli_timeout 120" | ||
|
||
client c1 { | ||
txreq -url "/" | ||
rxresp | ||
} -run | ||
|
||
varnish v1 -vcl { | ||
backend s2 { | ||
.host = "${s2_sock}"; | ||
} | ||
} | ||
|
||
varnish v1 -cliok "vcl.use vcl2" | ||
varnish v1 -cliok "vcl.discard vcl1" | ||
|
||
varnish v1 -expect n_backend == 1 | ||
varnish v1 -expect backend_conn == 1 | ||
varnish v1 -expect backend_reuse == 0 | ||
varnish v1 -expect backend_recycle == 1 |