From: Jeff King <peff@peff.net>
To: Koji Nakamaru <koji.nakamaru@gree.net>
Cc: Koji Nakamaru via GitGitGadget <gitgitgadget@gmail.com>,
git@vger.kernel.org
Subject: [PATCH 0/2] alternate approach to fixing fsmonitor hangs
Date: Tue, 8 Oct 2024 04:31:21 -0400 [thread overview]
Message-ID: <20241008083121.GA676391@coredump.intra.peff.net> (raw)
In-Reply-To: <CAOTNsDwwikiX3u6DG=+4hn+mcgfXzzDoqR3ZFVEdGi=mPGQbpg@mail.gmail.com>
On Mon, Oct 07, 2024 at 06:45:22PM +0900, Koji Nakamaru wrote:
> > - pthread_mutex_lock(&server_data->work_available_mutex);
> > + /* If we haven't started yet, we are already holding lock. */
> > + if (!server_data->started)
> > + pthread_mutex_lock(&server_data->work_available_mutex);
> >
> > server_data->shutdown_requested = 1;
>
> Is this condition inverted?
Yes, good catch.
> > I had also previously checked my suggested solution. So I do think
> > either is a valid solution to the problem.
>
> I also tested your approach on Windows with a few additions to
> ipc-win32.c, and it worked correctly.
Yeah, I never even tried building mine on Windows, and was just testing
via tmate on our macOS CI environment. :-/
I've added in the necessary Windows bits, along with smoothing a few
rough edges. Especially with the extra Windows changes (which I mostly
had to guess-and-check by pushing to CI), I'm beginning to wonder if my
solution isn't getting a bit too complicated, and maybe yours was the
right way after all.
But I've cleaned it up for presentation here, so at least we can look at
the final form of both and see which we prefer.
[1/2]: simple-ipc: split async server initialization and running
[2/2]: fsmonitor: initialize fs event listener before accepting clients
builtin/fsmonitor--daemon.c | 6 ++--
compat/fsmonitor/fsm-listen-darwin.c | 6 ++++
compat/fsmonitor/fsm-listen-win32.c | 6 ++++
compat/simple-ipc/ipc-shared.c | 5 +--
compat/simple-ipc/ipc-unix-socket.c | 28 +++++++++++++---
compat/simple-ipc/ipc-win32.c | 48 +++++++++++++++++++++++++---
simple-ipc.h | 17 +++++++---
7 files changed, 98 insertions(+), 18 deletions(-)
-Peff
next prev parent reply other threads:[~2024-10-08 8:31 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-02 9:47 [PATCH] fsmonitor: fix hangs by delayed fs event listening Koji Nakamaru via GitGitGadget
2024-10-07 5:58 ` Jeff King
2024-10-07 6:08 ` Jeff King
2024-10-07 9:45 ` Koji Nakamaru
2024-10-08 8:31 ` Jeff King [this message]
2024-10-08 8:33 ` [PATCH 1/2] simple-ipc: split async server initialization and running Jeff King
2024-10-08 8:36 ` [PATCH 2/2] fsmonitor: initialize fs event listener before accepting clients Jeff King
2024-10-08 16:03 ` [PATCH 0/2] alternate approach to fixing fsmonitor hangs Koji Nakamaru
2024-10-11 9:00 ` Jeff King
2024-10-11 18:01 ` Junio C Hamano
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=20241008083121.GA676391@coredump.intra.peff.net \
--to=peff@peff.net \
--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).