git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Koji Nakamaru <koji.nakamaru@gree.net>
Cc: Koji Nakamaru via GitGitGadget <gitgitgadget@gmail.com>,
	git@vger.kernel.org
Subject: Re: [PATCH v2] fsmonitor OSX: fix hangs for submodules
Date: Tue, 01 Oct 2024 11:04:31 -0700	[thread overview]
Message-ID: <xmqqmsjnya1c.fsf@gitster.g> (raw)
In-Reply-To: <CAOTNsDyg2SB-wd+a7vrctXck46jyfqV4uME6nf4YQZEafWbxMw@mail.gmail.com> (Koji Nakamaru's message of "Wed, 2 Oct 2024 02:51:47 +0900")

Koji Nakamaru <koji.nakamaru@gree.net> writes:

>> > +test_expect_success "submodule implicitly starts daemon by pull" '
>> > + test_atexit "stop_watchdog" &&
>> > + test_when_finished "stop_git && rm -rf cloned super sub" &&
>>
>> If stop_git ever returns with non-zero status, "rm -rf" will be
>> skipped, which I am not sure is a good idea.
>>
>> The whole test_when_finished would fail in such a case, so you would
>> notice the problem right away, which is a plus, though.
>
> t/README discusses that test_when_finished and test_atexit differ about
> the "--immediate" option. As git and its subprocesses are the test
> target, I moved stop_git to the current place. This might be however
> confusing when someone later reads this test. Should we simply put
> stop_git and stop_watchdong in test_atexit?

That is not what I meant.

I was merely questioning the &&-chaining that stops "rm -fr" from
running if stop_git ever fails (and your earlier iteration you had
multiple "rm -fr" ;-chained, not &&-chained---not using && is often
more appropriate in a when_finished handler).

>> > + set -m &&
>>
>> I have to wonder how portable (and necessary) this is.
>>
>> POSIX says it shall be supported if the implementation supports the
>> User Portability Utilities option.  It also says that it was added
>> to apply only to the UPE because it applies primarily to interactive
>> use, not shell script applications.  And our test scripts are of
>> course not interactive.
>
> How about the following modification? It still utilizes $git_pgid to
> filter processes, but avoids "set -m".

Nah, your original reads much better, and the code is grabbing and
using the process group information anyway (and my question about
"-m" was more about "should we be relying on process group features
in this test to kill them all?").

I am OK with the idea that we can assume, at least among the
platforms that support fsmonitor, that sending a signal to a process
group would cause the signal delivered to the member processes just
as we expect.

Thanks.

  reply	other threads:[~2024-10-01 18:04 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-29  2:41 [PATCH] fsmonitor OSX: fix hangs for submodules Koji Nakamaru via GitGitGadget
2024-09-30 17:40 ` Junio C Hamano
2024-10-01  4:11   ` Koji Nakamaru
2024-10-01  5:09 ` [PATCH v2] " Koji Nakamaru via GitGitGadget
2024-10-01 11:57   ` Junio C Hamano
2024-10-01 17:51     ` Koji Nakamaru
2024-10-01 18:04       ` Junio C Hamano [this message]
2024-10-01 18:42         ` Koji Nakamaru
2024-10-02  6:58           ` Koji Nakamaru
2024-10-02 18:14             ` Junio C Hamano
2024-10-03  8:54               ` Koji Nakamaru
2024-10-03 17:44                 ` Junio C Hamano
2024-10-04  2:42                   ` Koji Nakamaru
2024-10-01 19:29   ` [PATCH v3] " Koji Nakamaru via GitGitGadget
2024-10-04  0:07     ` [PATCH v4] " Koji Nakamaru via GitGitGadget
2024-10-04 17:44       ` Junio C Hamano
2024-10-04 18:47         ` Ramsay Jones
2024-10-04 19:07           ` Junio C Hamano
2024-10-05  3:12         ` Koji Nakamaru

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqmsjnya1c.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=koji.nakamaru@gree.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).