forked from git/git
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
credential-cache: handle ECONNREFUSED gracefully #5329
Open
rimrul
wants to merge
4
commits into
git-for-windows:main
Choose a base branch
from
rimrul:credential-cache-unknown-error
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
credential-cache: handle ECONNREFUSED gracefully #5329
rimrul
wants to merge
4
commits into
git-for-windows:main
from
rimrul:credential-cache-unknown-error
+165
−11
Conversation
This file contains 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
1 task
rimrul
force-pushed
the
credential-cache-unknown-error
branch
2 times, most recently
from
December 22, 2024 18:47
ff41d09
to
1059d6f
Compare
hickford
reviewed
Dec 23, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To distinguish the two identical error messages "unable to connect to cache daemon", consider changing the second to “unable to connect to spawned cache daemon”
rimrul
force-pushed
the
credential-cache-unknown-error
branch
3 times, most recently
from
December 28, 2024 12:22
87d0f06
to
a1ba9f8
Compare
We map WSAGetLastError() errors to errno errors in winsock_error_to_errno(), but the MSVC strerror() implementation only produces "Unknown error" for most of them. Produce some more meaningful error messages in these cases. Our builds for ARM64 link against the newer UCRT strerror() that does know these errors, so we won't change the strerror() used there. The wording of the messages is copied from glibc strerror() messages. Reported-by: M Hickford <[email protected]> Signed-off-by: Matthias Aßhauer <[email protected]>
The part about keeping the original error number hasn't been accurate since commit c11f75c (mingw: make sure errno is set correctly when socket operations fail, 2019-11-25) and the part about strerror() not knowing about these errors is untrue since the previous commit. Signed-off-by: Matthias Aßhauer <[email protected]>
rimrul
force-pushed
the
credential-cache-unknown-error
branch
from
December 29, 2024 09:30
a1ba9f8
to
de3a367
Compare
Commit 2406bf5 (Win32: detect unix socket support at runtime, 2024-04-03) introduced a runtime detection for wether the operating system supports unix sockets for Windows, but a mistake snuck into the tests. When building and testing Git without NO_UNIX_SOCKETS we currently skip t0301-credential-cache on Windows if unix sockets are supported and run the tests if they aren't. Flip that logic to actually work the way it was intended. Signed-off-by: Matthias Aßhauer <[email protected]>
In 245670c (credential-cache: check for windows specific errors, 2021-09-14) we concluded that on Windows we would always encounter ENETDOWN where we would expect ECONNREFUSED on POSIX systems, when connecting to unix sockets. As reported in [1], we do encounter ECONNREFUSED on Windows if the socket file doesn't exist, but the containing directory does and ENETDOWN if neither exists. We should handle this case like we do on non-windows systems. [1] git-for-windows#4762 (comment) This fixes git-for-windows#5314 Helped-by: M Hickford <[email protected]> Signed-off-by: Matthias Aßhauer <[email protected]>
rimrul
force-pushed
the
credential-cache-unknown-error
branch
from
December 29, 2024 11:08
de3a367
to
42da5df
Compare
Turns out, the existing tests would've caught this issue, if I hadn't unintentionally sabotaged them |
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.
I should probably add some tests for this.