Re: [PATCH 0/4] t5552: fix flakiness by introducing proper locking for GIT_TRACE
- From
Johannes Sixt <j6t@kdbg.org>
- Date
- Aug 10, 2018, 16:15 UTC
- Message-ID
- <811ded48-6f33-c46e-7bae-b9f7c7e8764c@kdbg.org>
- In-Reply-To
- <pull.17.git.gitgitgadget@gmail.com>
Am 09.08.2018 um 19:35 schrieb Johannes Schindelin via GitGitGadget:
Show 9 quoted lines
> I reported a couple of times that t5552 is not passing reliably. It has now > reached next, and will no doubt infect master soon. > > Turns out that it is not a Windows-specific issue, even if it occurs a lot > more often on Windows than elsewhere. > > The culprit is that two processes try simultaneously to write to the same > file specified via GIT_TRACE_PACKET, and it is not well defined how that > should work, even on Linux.
Thanks for digging down to the root cause. As has been said, the behavior of O_APPEND is well-defined under POSIX, but last time I looked for equivalent feature on Windows, I did not find any.
Last time was when I worked around the same failure in t5503-tagfollow.sh in my private builds:
https://github.com/j6t/git/commit/9a447a6844b50b43746d9765b3ac809e2793d742
It is basically the same as Peff suggests: log only one side of the fetch.
As this buglet looks like a recurring theme, and a proper fix is preferable over repeated work-arounds. To me it looks like we need some sort of locking on Windows. Unless your friends at Microsoft have an ace in their sleeves that lets us have atomic O_APPEND the POSIX way...
-- Hannes