Mercurial > hg > ngx_http_upstream_keepalive
diff t/memcached-keepalive.t @ 24:2ee28064a04a 0.4
Keepalive: correctly close connections on gracefull shutdown.
On gracefull shutdown nginx calls read handler on all idle connections with
c->close set. Make sure we don't confuse such read handler calls with stale
events and actually close connections. This fixes "open socket ... left
in connection ..." alerts.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Wed, 15 Dec 2010 21:12:36 +0300 |
parents | 8d8eaaf07663 |
children | 489c5d4318ff |
line wrap: on
line diff
--- a/t/memcached-keepalive.t +++ b/t/memcached-keepalive.t @@ -20,12 +20,11 @@ select STDOUT; $| = 1; eval { require Cache::Memcached; }; plan(skip_all => 'Cache::Memcached not installed') if $@; -my $t = Test::Nginx->new()->has('rewrite')->has_daemon('memcached')->plan(16) +my $t = Test::Nginx->new()->has('rewrite')->has_daemon('memcached')->plan(17) ->write_file_expand('nginx.conf', <<'EOF'); %%TEST_GLOBALS%% -master_process off; daemon off; events { @@ -202,4 +201,8 @@ is($memd1->stats()->{total}->{total_conn $memd2->stats()->{total}->{total_connections}, $total + 2, 'connection per backend'); +$t->stop(); + +like(`grep -F '[alert]' ${\($t->testdir())}/error.log`, qr/^$/s, 'no alerts'); + ###############################################################################