-
Notifications
You must be signed in to change notification settings - Fork 41
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
Gathering certificates can get stuck if the server doesn't respond #567
Comments
Here are some timeout values used by ECF which is used by p2. Having a default value that can be modified via a system property would be good I think. The tricky question is how to handle a timeout, with a retry like in other places in p2? And, most importantly, how is the failure to identify/retrieve the host certificate presented to the user? Is this some type of problem with the host not supporting a head request? Is there a way I can reproduce the problem. Sometime is a little fishy if we can load the repository but we cannot get a certificate... |
I think it happens if the server accepts the connection but infinitely waits for the response so it would only happen if something is wrong with the server (but it should still not lead to it being stuck forever). I don't know what exactly caused it for the user who experienced it but I guess the server causing the issue probably had some issue with
I guess using some sort of retry makes sense. For how to present the failure, the other code for certificate handling just doesn't add the certificate which I think makes sense. However, I think at least adding a warning to the error log makes sense.
I agree with that and I think it might make sense to allow configuring it with an existing system property like reusing |
I can easily reproduce using the following steps:
Then it automatically executes Given that information, it seems to not be necessarily specific to |
FYI, I'm on Windows and my bash doesn't have an nc command... |
Entering |
Someone on Stack Overflow experienced an issue where installing updates got stuck waiting for the certificates (which was introduced with #235).
httpResponse.get()
might wait forever if the request takes forever which is possible because no timeout is set andHttpClient
blocks forever by default. I didn't find any other uses ofHttpRequest.newBuilder()
in p2.I suggest adding a timeout to this and I am willing to contribute that (unless someone else really wants to do that).
Are there any opinions on a good timeout? I would suggest something along the line of 2-5 seconds since the HTTP request taking more time would indicate some sort of issue in which case not accepting the certificate is probably fine.
The text was updated successfully, but these errors were encountered: