-
Notifications
You must be signed in to change notification settings - Fork 187
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
libgit2: managed transport improvements #658
Merged
Merged
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
pjbgf
force-pushed
the
libgit2-fixes
branch
5 times, most recently
from
April 7, 2022 16:47
51bd024
to
4f88ceb
Compare
SSH servers that block the reuse of SSH connections for multiple SSH sessions may lead to EOF when a new session is being created. This fixes the issue of long-running connections resulting in EOF for GitLab servers. Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
Internal and upstream calls to sshSmartSubtransport.Close() when dealing with an stale connection, may lead to misleading errors. Focus should instead be redirected to ensuring that Close() releases resources and ensures that a new SubTransport can be created, so new operations can succeed. Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
The major Git SaaS providers have repository URLs for both HTTP and SSH that tops around 250 characters in length. The limits chosen were a lot higher to align with use cases in which users may have on-premise servers with long domain names and paths. For SSH the validation is around path length only, which is now limited to 4096 characters, which is at the higher end of the range in Linux. For HTTP the validation is around the full URL provided by the caller. Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
Avoid asking for SSH credential in files, as they won't be used. The cacheKeyAndConfig func already enforces this behaviour. Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
Cached connections can be shared across concurrent operations, and their disposal must take that into account to avoid closing a connection that is stale for one goroutine, but is still valid for another. Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
Previously the mutex.Lock was acquired before creating a new connection. The lock would then hold until the process was finished, and all network latency would be absorbed by other goroutines trying to establish a new connection. Now the lock is acquired after the connection has been created. The downside of this approach is that concurrent goroutine may be trying to open a connection to the same target. The loser in the race will then have to Close the connection and use the winner's instead. Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
hiddeco
approved these changes
Apr 7, 2022
darkowlzz
approved these changes
Apr 7, 2022
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.
LGTM!
This was referenced Apr 8, 2022
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.
Stability and reliability improvements
EOF
for GitLab servers. Although this may also affect other Git Servers in different scenarios.Low Impact Breaking Changes