]> Kevux Git Server - rit/commit
transport-helper: fix TSAN race in transfer_debug()
authorPushkar Singh <pushkarkumarsingh1970@gmail.com>
Tue, 9 Jun 2026 13:47:42 +0000 (13:47 +0000)
committerJunio C Hamano <gitster@pobox.com>
Tue, 9 Jun 2026 21:05:42 +0000 (14:05 -0700)
commit85704eda1820b350a9916b17d6d25fa33f68207d
treeec8989583c3028a16b7c6f4e43244d7c0a2d2e7d
parenta89346e34a937f001e5d397ee62224e3e9852040
transport-helper: fix TSAN race in transfer_debug()

Currently, transfer_debug() lazily initializes a static variable based
on GIT_TRANSLOOP_DEBUG. Since the function may be called from multiple
worker threads, this initialization is racy and is therefore suppressed
in .tsan-suppressions.

Initialize the variable in bidirectional_transfer_loop() before any
worker threads or processes are created. This patch removes the race and
allows dropping the corresponding TSAN suppression.

Signed-off-by: Pushkar Singh <pushkarkumarsingh1970@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
.tsan-suppressions
transport-helper.c