-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
fix: configure ssh connect timeout value #2394
Conversation
Can you please provide a better description than WIP, otherwise it may be better to work on this in your own branch before you submit a PR. |
Sorry, I hit draft by accident. Please let me know if you require additional details. |
I'm looking for feedback on:
|
It seems to make sense on my reading of the code, but you would have to test it |
Testing the timeout is a bit challenging because I don't have any malfunctioning Git servers and I wouldn't be able to introduce lag if I stood one up. Sadly, the Without modifying the JGit code, To me this is enough to show the flag is working, unfortunately I can't witness fetch timeouts on subsequent calls to Spring Cloud Config Server because the timeout will fail on startup. Please let me know if I'm ok to proceed and I'll look into adding tests to Spring Cloud Config, but it is unlikely I'll be able to test something so fine grained like this in the project. @Override
public SshdSession getSession(URIish uri, CredentialsProvider credentialsProvider, FS fs, int tms) throws TransportException {
return super.getSession(uri, credentialsProvider, fs, 50);
} Stacktrace
|
Modify `PropertyBasedSshSessionFactory` and `FileBasedSshSessionFactory` to configure `SshConstants.CONNECT_TIMEOUT` based on the supplied timeout property
bc3dc53
to
d5df163
Compare
We've always had a concern about knowing if and how we can set timeout for SSH. If it's now supporting configuration of a SSH read and/or connection time (and didn't support it before?), was there a corresponding documentation update that explains how to configure it? It wasn't obvious to me by scanning over the code changes. |
Documentation was added in #2396 |
Modify
PropertyBasedSshSessionFactory
andFileBasedSshSessionFactory
to configureSshConstants.CONNECT_TIMEOUT
based on the supplied timeout property.This is a work in progress and I'm looking for feedback.
I created #2393 as a temporary solution to #2256 (comment).
What I'm really after is setting the SSH read timeout for Git.
I'm using the
CONNECT_TIMEOUT
key from JGit to hopefully accomplish this.