forked from git/git
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Fix t5516 flakiness in MSVC builds #2373
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FYI @SyntevoAlex |
455026c
to
e426627
Compare
This is actually a companion PR to gitgitgadget#428 (which probably won't make it into -rc2, hence this PR because I want to get these patches so that I don't have to re-run so many build jobs per day). |
bd4bc28
to
fce0894
Compare
The MSVC runtime behavior differs from glibc's with respect to `fprintf(stderr, ...)` in that the former writes out the message character by character. In t5516, this leads to a funny problem where a `git fetch` process as well as the `git upload-pack` process spawned by it _both_ call `die()` at the same time. The output can look like this: fatal: git uploadfata-lp: raemcokte :error: upload-pnot our arcef k6: n4ot our ea4cr1e3f 36d45ea94fca1398e86a771eda009872d63adb28598f6a9 8e86a771eda009872d6ab2886 Let's avoid this predicament altogether by rendering the entire message, including the prefix and the trailing newline, into the buffer we already have (and which is still fixed size) and then write it out via `write_in_full()`. We still clip the message to at most 4095 characters. The history of `vreportf()` with regard to this issue includes the following commits: d048a96 (2007-11-09) - 'char msg[256]' is introduced to avoid interleaving 389d176 (2009-03-25) - Buffer size increased to 1024 to avoid truncation 625a860 (2009-11-22) - Buffer size increased to 4096 to avoid truncation f4c3edc (2015-08-11) - Buffer removed to avoid truncation b5a9e43 (2017-01-11) - Reverts f4c3edc to be able to replace control chars before sending to stderr 9ac13ec (2006-10-11) - Another attempt to solve interleaving. This is seemingly related to d048a96. 137a0d0 (2007-11-19) - Addresses out-of-order for display() 34df8ab (2009-03-10) - Switches xwrite() to fprintf() in recv_sideband() to support UTF-8 emulation eac14f8 (2012-01-14) - Removes the need for fprintf() for UTF-8 emulation, so it's safe to use xwrite() again 5e5be9e (2016-06-28) - recv_sideband() uses xwrite() again Note that we print nothing if the `vsnprintf()` call failed to render the error message; There is little we can do in that case, and it should not happen anyway. The process may have written to `stderr` and there may be something left in the buffer kept in the stdio layer. Call `fflush(stderr)` before writing the message we prepare in this function. Helped-by: Jeff King <[email protected]> Helped-by: Alexandr Miloslavskiy <[email protected]> Helped-by: SZEDER Gábor <[email protected]> Helped-by: Junio C Hamano <[email protected]> Signed-off-by: Johannes Schindelin <[email protected]>
fce0894
to
f6d6c81
Compare
dscho
added a commit
to dscho/git
that referenced
this pull request
Oct 30, 2019
Fix t5516 flakiness in MSVC builds
git-for-windows-ci
pushed a commit
that referenced
this pull request
Oct 30, 2019
Fix t5516 flakiness in MSVC builds
dscho
added a commit
that referenced
this pull request
Oct 30, 2019
Fix t5516 flakiness in MSVC builds
dscho
added a commit
that referenced
this pull request
Oct 30, 2019
Fix t5516 flakiness in MSVC builds
dscho
added a commit
that referenced
this pull request
Oct 30, 2019
Fix t5516 flakiness in MSVC builds
git-for-windows-ci
pushed a commit
that referenced
this pull request
Nov 2, 2019
Fix t5516 flakiness in MSVC builds
git-for-windows-ci
pushed a commit
that referenced
this pull request
Nov 2, 2019
Fix t5516 flakiness in MSVC builds
dscho
added a commit
that referenced
this pull request
Nov 2, 2019
Fix t5516 flakiness in MSVC builds
dscho
added a commit
to dscho/git
that referenced
this pull request
Nov 4, 2019
Fix t5516 flakiness in MSVC builds
Merged
git-for-windows-ci
pushed a commit
that referenced
this pull request
Nov 4, 2019
Fix t5516 flakiness in MSVC builds
git-for-windows-ci
pushed a commit
that referenced
this pull request
Nov 4, 2019
Fix t5516 flakiness in MSVC builds
git-for-windows-ci
pushed a commit
that referenced
this pull request
Nov 5, 2019
Fix t5516 flakiness in MSVC builds
git-for-windows-ci
pushed a commit
that referenced
this pull request
Nov 5, 2019
Fix t5516 flakiness in MSVC builds
dscho
added a commit
that referenced
this pull request
Nov 6, 2019
Fix t5516 flakiness in MSVC builds
dscho
added a commit
that referenced
this pull request
Nov 6, 2019
Fix t5516 flakiness in MSVC builds
dscho
added a commit
that referenced
this pull request
Nov 6, 2019
Fix t5516 flakiness in MSVC builds
git-for-windows-ci
pushed a commit
that referenced
this pull request
Nov 11, 2019
Fix t5516 flakiness in MSVC builds
git-for-windows-ci
pushed a commit
that referenced
this pull request
Nov 11, 2019
Fix t5516 flakiness in MSVC builds
dscho
added a commit
that referenced
this pull request
Nov 16, 2019
Fix t5516 flakiness in MSVC builds
dscho
added a commit
that referenced
this pull request
Nov 16, 2019
Fix t5516 flakiness in MSVC builds
dscho
added a commit
that referenced
this pull request
Nov 16, 2019
Fix t5516 flakiness in MSVC builds
dscho
added a commit
that referenced
this pull request
Nov 25, 2019
Fix t5516 flakiness in MSVC builds
git-for-windows-ci
pushed a commit
that referenced
this pull request
Nov 25, 2019
Fix t5516 flakiness in MSVC builds
dscho
added a commit
that referenced
this pull request
Nov 26, 2019
Fix t5516 flakiness in MSVC builds
dscho
added a commit
that referenced
this pull request
Dec 7, 2019
Fix t5516 flakiness in MSVC builds
dscho
added a commit
that referenced
this pull request
Dec 10, 2019
Fix t5516 flakiness in MSVC builds
git-for-windows-ci
pushed a commit
that referenced
this pull request
Dec 10, 2019
Fix t5516 flakiness in MSVC builds
git-for-windows-ci
pushed a commit
that referenced
this pull request
Dec 13, 2019
Fix t5516 flakiness in MSVC builds
dscho
added a commit
that referenced
this pull request
Dec 29, 2019
Fix t5516 flakiness in MSVC builds
dscho
added a commit
that referenced
this pull request
Jan 4, 2020
Fix t5516 flakiness in MSVC builds
dscho
added a commit
that referenced
this pull request
Jan 13, 2020
Fix t5516 flakiness in MSVC builds
git-for-windows-ci
pushed a commit
that referenced
this pull request
Jan 16, 2020
Fix t5516 flakiness in MSVC builds
git-for-windows-ci
pushed a commit
that referenced
this pull request
Jan 17, 2020
Fix t5516 flakiness in MSVC builds
git-for-windows-ci
pushed a commit
that referenced
this pull request
Jan 22, 2020
Fix t5516 flakiness in MSVC builds
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is based, in part, on gitgitgadget#407, but it avoids the complexity incurred by the desire to allow for unlimited messages.