From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS31976 209.132.180.0/23 X-Spam-Status: No, score=-4.5 required=3.0 tests=AWL,BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD shortcircuit=no autolearn=ham autolearn_force=no version=3.4.0 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by dcvr.yhbt.net (Postfix) with ESMTP id C46B71F6BF for ; Thu, 8 Sep 2016 08:06:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934099AbcIHIG0 (ORCPT ); Thu, 8 Sep 2016 04:06:26 -0400 Received: from mout.gmx.net ([212.227.17.20]:49559 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S936176AbcIHIGL (ORCPT ); Thu, 8 Sep 2016 04:06:11 -0400 Received: from virtualbox ([37.24.141.250]) by mail.gmx.com (mrgmx103) with ESMTPSA (Nemesis) id 0LikyX-1bBrmU31J7-00czBd; Thu, 08 Sep 2016 10:05:59 +0200 Date: Thu, 8 Sep 2016 10:05:58 +0200 (CEST) From: Johannes Schindelin X-X-Sender: virtualbox@virtualbox To: Jeff King cc: Junio C Hamano , Johannes Sixt , Git Mailing List Subject: Re: [PATCH] t6026-merge-attr: wait for process to release trash directory In-Reply-To: <20160907190004.dw3p6fxkdaubwuvu@sigill.intra.peff.net> Message-ID: References: <3fd38b71-26bd-bdb3-fe5c-e7038abf51e0@kdbg.org> <20160906072707.goysliw32xgwmlol@sigill.intra.peff.net> <20160907190004.dw3p6fxkdaubwuvu@sigill.intra.peff.net> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Provags-ID: V03:K0:Jy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pD1RjOgcEObwKWAqSBLfyyIB hTINkso Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Hi Peff & Junio, On Wed, 7 Sep 2016, Jeff King wrote: > On Wed, Sep 07, 2016 at 11:39:57AM -0700, Junio C Hamano wrote: > > > > Can we do some signaling with fifos to tell the hook when it is safe to > > > exit? Then we would just need to `wait` for its parent process. > > > > Is fifo safe on Windows, though? > > No clue. We seem to use mkfifo unconditionally in lib-daemon, but > perhaps people do not run that test on Windows. Other invocations seem > to be protected by the PIPE prerequisite. But... AFAICT we do not use mkfifo on Windows. Let's see what t/test-lib.sh has to say about the matter: test_lazy_prereq PIPE ' # test whether the filesystem supports FIFOs case $(uname -s) in CYGWIN*|MINGW*) false ;; *) rm -f testfifo && mkfifo testfifo ;; esac ' So there you go. The reason it is disabled is that Cygwin/MSYS2 do have a concept of a FIFO. But `git.exe` won't be able to access such a FIFO because it is emulated by the POSIX emulation layer, which Git cannot access. > > With v2 that explicitly kills, I guess we can make the sleep longer > > without slowing down in the optimistic case? > > Yeah, I think the v2 one is non-racy (I thought at first we might race > with the "echo", but it should be synchronous; the hook will not exit > until we have written the pid file, and git will not exit until the hook > is done running). Please note that Hannes and I discussed this (as I originally suggested to increase it to 10 seconds, and Hannes rightfully pointed out that we would have to change the script name, too, as it says sleep-one-second.sh, and that would have made the patch less readable) and we came to the same conclusion: it's not necessary. Ciao, Dscho