From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS3215 2.6.0.0/16 X-Spam-Status: No, score=-3.3 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by dcvr.yhbt.net (Postfix) with ESMTP id B27051F403 for ; Mon, 27 Jun 2022 03:55:05 +0000 (UTC) Authentication-Results: dcvr.yhbt.net; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="fMxDGGbo"; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231753AbiF0Dxb (ORCPT ); Sun, 26 Jun 2022 23:53:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41208 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230174AbiF0Dxa (ORCPT ); Sun, 26 Jun 2022 23:53:30 -0400 Received: from mail-il1-x12e.google.com (mail-il1-x12e.google.com [IPv6:2607:f8b0:4864:20::12e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5164F2ADD for ; Sun, 26 Jun 2022 20:53:30 -0700 (PDT) Received: by mail-il1-x12e.google.com with SMTP id i17so5181486ils.12 for ; Sun, 26 Jun 2022 20:53:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=0F076kjS66jQmT/jdnCM869O44Hd5+YZNKOUf9Kiil4=; b=fMxDGGbortU/of2TjMCK9hstjFLzF60qzcquk9ZNr/q/UJwLiseeymI43YswJ1CBQI IBXkvCWmVYb5pLwHRY/2n7ZzF0g+F3Cz0sdXf7LQ4NRYHikJfX1BXs6qE3/phaXI7Gc9 3gT6B9uiijCqUxQ+CYlTku9LApsCJmowu6DKjfuFFfJdY/4g0TU2VKZ1rLJfTt/VXTEL OM2+4KNnYU0NsHyXwFIbT3XIxpWxgPzGdZ06S9Mgx0aMAF+w4F8f0PL6uUAyKNIz63Kv jZV3II1qOf+2JVC++jvmqvYsSjhfD4QQnSV29E/tYLKu0Pwbce+w4C9KCBMRwkLKICuL y9yA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=0F076kjS66jQmT/jdnCM869O44Hd5+YZNKOUf9Kiil4=; b=JbgohMTPd84xCLW+b4OBhRYAGMRluXMAf2PQOkfoGg9kqpYnMSQ1vha1G2z2+lwJyw 09N998ARxSvm/U+54ZPnUgU0UzBljEHbQiWahmSc+fd89CjPk/QVji3d8duW/yOHJIZo pT4GwlK6woXDfnoxexYyF0Kt/sUbX5U5q1tN83cD7oghoWhUxi3krP6NvYPz6HkCqSkI vH19tUsVVy2PQqpsjVNCsrSFMIqmWkR2KrU+qemAZrJ9Vu1rPchWVVc5cTjyqQjO0ktf uqUPoUKBnaBuTyKetU/qBGcdclJz4MER6LxtkiITB10HPfEyE6gITpJcfgKPo9vlKBun xTnw== X-Gm-Message-State: AJIora/YpHdbfcVvaAggNJs4yHED+gIOjE/KzJ8oc/jnV/MUmEoIPdF7 /WknBIZsBQT56ez/pQyIMyFt36fpakzeX1TfiBob54ftMcE= X-Google-Smtp-Source: AGRyM1vSlv4+f6+jF2qUzdHJ2VgN5y1pP5K+7MR3atLD/Wi9aPiJbdC9RyQUrBeTiJpuEIa9HwmAVqOt3eaen5ZgU7M= X-Received: by 2002:a05:6e02:1547:b0:2da:9637:7566 with SMTP id j7-20020a056e02154700b002da96377566mr1680998ilu.47.1656302009676; Sun, 26 Jun 2022 20:53:29 -0700 (PDT) MIME-Version: 1.0 References: <20220622115014.53754-1-haoyurenzhuxia@gmail.com> <220622.86a6a4lmdv.gmgdl@evledraar.gmail.com> In-Reply-To: <220622.86a6a4lmdv.gmgdl@evledraar.gmail.com> From: Xiaowen Xia Date: Mon, 27 Jun 2022 11:53:18 +0800 Message-ID: Subject: Re: [RFC PATCH] midx.c: clean up .rev file To: =?UTF-8?B?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= Cc: Git List , Taylor Blau , derrickstolee@github.com, dyroneteng@gmail.com Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Thanks for your attention. > Is the rest of this API thread safe, and no longer is because of this? > You're doing this because... * The `gettext()` and `fputs()` which calls in `die_errno(_())` are seem highly unlikely async-signal-safety, this may cause problems in signal handlers, I should remove it. * This is thread-safe. The *.rev file will no longer be read/written after creating the signal handler by `sigchain_push_common()`. * On the other hand, the command: `git multi-pack-index write --bitmap` will create an lockfile named `multi-pack-index.lock` and the signal handler will not affect the execution of the same command or git-process. The purpose of this patch is the same as what Teng Long said, to clean up the files generated by the process when the process exits abnormally. Thanks.