]> Sergey Matveev's repositories - public-inbox.git/blobdiff - public-inbox-nntpd
nntpd: hard quit after 30s
[public-inbox.git] / public-inbox-nntpd
index defb16b15b6493304d9effbec100c64399bfa052..4c1560803e221c279be82a4de40637a6ee06393c 100644 (file)
@@ -195,10 +195,14 @@ sub worker_quit {
        $_->close for @listeners;
        @listeners = ();
 
+       # give slow clients 30s to finish reading/writing whatever
+       Danga::Socket->AddTimer(30, sub { exit });
+
        # drop idle connections and try to quit gracefully
        Danga::Socket->SetPostLoopCallback(sub {
                my ($dmap, undef) = @_;
                my $n = 0;
+
                foreach my $s (values %$dmap) {
                        next unless ref($s) eq 'PublicInbox::NNTP';
                        if ($s->{write_buf_size} || $s->{rbuf}) {