From: Junio C Hamano Date: Thu, 04 Jun 2026 01:09:43 GMT Subject: Re: [PATCH] transport-helper: fix TSAN race in transfer_debug() Message-ID: In-Reply-To: <20260602201309.38434-2-pushkarkumarsingh1970@gmail.com> Pushkar Singh writes: > +static int transfer_debug_enabled = -1; > ... > - if (debug_enabled < 0) > - debug_enabled = getenv("GIT_TRANSLOOP_DEBUG") ? 1 : 0; > - if (!debug_enabled) > + if (!transfer_debug_enabled) > return; Would it be possible that transfer_debug_enabled is still -1 at this point? We would proceed in such a case, which is a bit different from what would have happened in the original. Perhaps if (transfer_debug_enabled <= 0) return; is what you want? I dunno. > @@ -1648,6 +1640,9 @@ int bidirectional_transfer_loop(int input, int output) > { > struct bidirectional_transfer_state state; > > + if (transfer_debug_enabled < 0) > + transfer_debug_enabled = getenv("GIT_TRANSLOOP_DEBUG") ? 1 : 0; > + > /* Fill the state fields. */ > state.ptg.src = input; > state.ptg.dest = 1;