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=1.5 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,LIST_MIRROR_RECEIVED,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE shortcircuit=no autolearn=no 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 43D211F670 for ; Thu, 3 Mar 2022 16:50:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235175AbiCCQvO (ORCPT ); Thu, 3 Mar 2022 11:51:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40342 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235163AbiCCQvN (ORCPT ); Thu, 3 Mar 2022 11:51:13 -0500 Received: from siwi.pair.com (siwi.pair.com [209.68.5.199]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 805D819D772 for ; Thu, 3 Mar 2022 08:50:27 -0800 (PST) Received: from siwi.pair.com (localhost [127.0.0.1]) by siwi.pair.com (Postfix) with ESMTP id BCA883F4851; Thu, 3 Mar 2022 11:50:26 -0500 (EST) Received: from jeffhost-mbp.local (162-238-212-202.lightspeed.rlghnc.sbcglobal.net [162.238.212.202]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by siwi.pair.com (Postfix) with ESMTPSA id 89FE43F4844; Thu, 3 Mar 2022 11:50:26 -0500 (EST) Subject: Re: [PATCH 17/23] fsmonitor--daemon: stub in health thread To: Derrick Stolee , Jeff Hostetler via GitGitGadget , git@vger.kernel.org Cc: Jeff Hostetler References: <4a77f5b1fdef3af20fbfefccccc5fee194eb3422.1644940774.git.gitgitgadget@gmail.com> <4c784936-7b70-3910-6413-0438e86b23c4@github.com> From: Jeff Hostetler Message-ID: <3ac0116c-4d82-55d0-6e17-75c3de392bbf@jeffhostetler.com> Date: Thu, 3 Mar 2022 11:50:24 -0500 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org On 2/24/22 11:15 AM, Derrick Stolee wrote: > On 2/24/2022 11:04 AM, Derrick Stolee wrote: >> On 2/15/2022 10:59 AM, Jeff Hostetler via GitGitGadget wrote: >>> From: Jeff Hostetler >>> >>> Create another thread to watch over the daemon process and >>> automatically shut it down if necessary. >>> >>> This commit creates the basic framework for a "health" thread >>> to monitor the daemon and/or the file system. Later commits >>> will add platform-specific code to do the actual work. >> >> ... >> >>> diff --git a/compat/fsmonitor/fsm-health-darwin.c b/compat/fsmonitor/fsm-health-darwin.c >>> new file mode 100644 >>> index 00000000000..b9f709e8548 >>> --- /dev/null >>> +++ b/compat/fsmonitor/fsm-health-darwin.c >>> @@ -0,0 +1,24 @@ >>> +#include "cache.h" >>> +#include "config.h" >>> +#include "fsmonitor.h" >>> +#include "fsm-health.h" >>> +#include "fsmonitor--daemon.h" >>> + >>> +int fsm_health__ctor(struct fsmonitor_daemon_state *state) >>> +{ >>> + return 0; >>> +} >>> + >>> +void fsm_health__dtor(struct fsmonitor_daemon_state *state) >>> +{ >>> + return; >>> +} >>> + >>> +void fsm_health__loop(struct fsmonitor_daemon_state *state) >>> +{ >>> + return; >>> +} >>> + >>> +void fsm_health__stop_async(struct fsmonitor_daemon_state *state) >>> +{ >>> +} >> >> The macOS implementation is stubbed, as advertised. > > After looking at the rest of the patch series, it seems that these > are never filled in. Are some of the win32 health monitors also > appropriate for macOS? (They would need platform-specific checks, > probably.) Yes, there are some asymmetries here. For example: On MacOS we get a notification at part of the existing watch if the repo root directory is moved or renamed, so (in a later commit) we can add code to the listener thread to check for that; however, on Windows we don't, so we have to poll for it in the health thread using timers and the BY_HANDLE_FILE_INFORMATION data. Here I'm just stubbing in a trivial health thread so that the framework is complete for the supported platforms. Thanks, Jeff