From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.2 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, T_SCC_BODY_TEXT_LINE shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id CB7E21F406 for ; Wed, 1 Nov 2023 06:31:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1698820308; bh=rahoUEQ619+RWE6ECRsaNUHPZ18+/etZOvfGzoAe1HI=; h=From:To:Subject:Date:From; b=JHCXo75Dpng/GOBDm8BXbTiZcoF/9hv8fNOUMEmBIDyoHUTe3ohCPhW0c54NDfqyr vsXbbSzmMNh7ZBZlnXCUZYaPngC21Mw01rLNnuxzUlMxl2VcBo9vkvT3rXdX5YA2bU WrE/5rurveYxwppJ0HJpzV1FSqEDtSLOstxTTRng= From: Eric Wong To: meta@public-inbox.org Subject: [PATCH] git: reschedule cleanup if activea Date: Wed, 1 Nov 2023 06:31:48 +0000 Message-ID: <20231101063148.2480-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: This is necessary to reliably cleanup cat-file processes for coderepos in long-lived -netd and -httpd processes if they haven't been accessed in a while. Followup-to: 33e99002c552 (git: cleanup un-associated coderepo processes) --- lib/PublicInbox/Git.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/PublicInbox/Git.pm b/lib/PublicInbox/Git.pm index a1d52118..191e4eea 100644 --- a/lib/PublicInbox/Git.pm +++ b/lib/PublicInbox/Git.pm @@ -476,7 +476,8 @@ sub async_wait_all ($) { # returns true if there are pending "git cat-file" processes sub cleanup { my ($self, $lazy) = @_; - return 1 if $lazy && _active($self); + ($lazy && _active($self)) and + return $self->{epwatch} ? watch_async($self) : 1; local $in_cleanup = 1; async_wait_all($self); $_->close for ($self, (delete($self->{ck}) // ()));