-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
OkHttp causes JVM 11 to hang with HTTP/2 #5832
Comments
I'm aware that // MyLibrary.java
import okhttp3.OkHttpClient;
import okhttp3.Request;
public class MyLibrary
{
private static final OkHttpClient client = new OkHttpClient.Builder().build();
public static String getData() throws Throwable
{
return client.newCall(new Request.Builder().url("https://en.wikipedia.org/w/api.php").build()).execute().body().string();
}
} and // A.java
public class A
{
public static void main(String[] args) throws Throwable
{
System.out.println(MyLibrary.getData());
}
} If I'm the author of It becomes especially problematic if that other developer has written hundreds of standalone programs with I'd also like to point out that using OkHttp with HTTP/1.1 doesn't require |
PR to use a daemon thread for clients to be consistent for HTTP/2 and HTTP/1.1 |
Fixed in 4.5.1-RC1. |
- override 'okhttp' (square/okhttp#5832)
- override 'okhttp' (square/okhttp#5832)
The following code
doesn't exit for several minutes in java 11. I'm using the 4.4.0 release of OkHttp.
Run and compile with
javac A.java && java A
My environment (macOS Catalina 10.15.3):
Likely related to #4029, which wasn't actually fixed apparently.
The text was updated successfully, but these errors were encountered: