-
Notifications
You must be signed in to change notification settings - Fork 43
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
Add timeout to gathering host certificates #567 #577
Conversation
4d5d6e8
to
0270ca1
Compare
I hope the way I updated the versions in the |
Test Results 250 files - 125 250 suites - 125 27m 24s ⏱️ - 19m 37s Results for commit dc2d50b. ± Comparison against base commit b4a50b8. This pull request removes 6 tests.
♻️ This comment has been updated with latest results. |
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.
Overall it's nice work and much appreciated! Just a few very tiny nits and I think we're good to go.
...se.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/phases/AuthorityChecker.java
Outdated
Show resolved
Hide resolved
...se.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/phases/AuthorityChecker.java
Outdated
Show resolved
Hide resolved
...se.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/phases/AuthorityChecker.java
Outdated
Show resolved
Hide resolved
...se.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/phases/AuthorityChecker.java
Outdated
Show resolved
Hide resolved
I have committed the requested changes. I assume the GitHub Actions failure ( |
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.
Looks good now. Could you please squash this into a single commit and force push it?
...se.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/phases/AuthorityChecker.java
Outdated
Show resolved
Hide resolved
...se.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/phases/AuthorityChecker.java
Outdated
Show resolved
Hide resolved
7e5cd33
to
0637151
Compare
I made the requested changes (I had to bump the minor version of one bundle due to adding |
0637151
to
4f6d358
Compare
bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/p2/core/IProvisioningAgent.java
Show resolved
Hide resolved
bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/p2/core/IProvisioningAgent.java
Show resolved
Hide resolved
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.
Only the version of bundles/org.eclipse.equinox.p2.core/META-INF/MANIFEST.MF should be fixed. The rest is at your discretion.
Thanks for being so super responsive! You're awesome!!
4f6d358
to
dc2d50b
Compare
When the build passes, it's ready to merge. 🥇 |
Thanks again!! ❤️ |
As explained in #567, it is currently possible that Eclipse waits infinitely for a host certificate in case the server accepting the request but not responding after that. This issue caused the plugin installation of a Stack Overflow user to get stuck.
This PR adds a timeout and retrying using the properties
org.eclipse.equinox.p2.engine.requestTimeout
andorg.eclipse.equinox.p2.engine.requestRetries
.How to test
nc -l 8080 -k
on Linux or using Java code similar to the following (not using TLS for simplicity):Preferences
>Install/Update
>Trust
>Authorities
http
toAllow
Add
http://localhost:8080
Without this change, Eclipse sends one HTTP request to this server, never closes the request and the thread is blocked forever.
With this change, it sends multiple (by default 3) requests to the server and then skips the host.
Other changes
I also added a warning log when gathering certificates throws an exception. I made sure the current thread is reinterrupted when an
InterruptedException
is thrown (and not logging anything since that seems unnecessary).Notes
Since I didn't find a property that I felt was actually applicable to reuse for the timeout and retry count, I created new ones. I decided on a default of 2 retries (i.e. 3 requests in total) with a timeout (not the connection timeout but the timeout of the request, i.e. when waiting for a response after connecting) of 5 seconds. I didn't include a backoff time between requests but I could still add that if wanted.