-
Notifications
You must be signed in to change notification settings - Fork 660
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
Apollo Client hangs in Java / Spring Boot app #1896
Comments
I've used Apollo in a command-line app that hanged because the Apollo client uses a ThreadPool and the JVM would not close until all threads terminated. I called |
Yes, it appears that there are extra threads blocking. Isn't this going to be an issue in any kind of application if there is no way to cleanly shutdown the thread pool? |
Just for the heck of it, I tried .dispatcher(MoreExecutors.directExecutor()) on my ApolloClient builder which, from looking at the code, should disable the ThreadPool... still hangs... ugh... getting close to pulling the plug on this and just using WebClient. |
The corresponding OkHttp issue: square/okhttp#5542 In some other app of mine (without apollo), a similar issue was fixed by upgrading okhttp to 4.4.0. We should update okhttp. This will bring a kotlin-stdlib dependency but I think it's okay considering #1784 |
@SledgeHammer01 can you check with Apollo 2.0? Thanks |
Maybe duplicate of #3619? We've upgraded OkHttp to 4.x and this should not happen anymore. Can you try with Apollo Android 3 and let us know how that goes? |
Closing as obsolete. Please leave a message if you want us to reopen. |
I'm trying to use the Apollo Client Java in my Spring Boot 2.2.2.RELEASE app. Just a simple console app test app that calls my GraphQL server. The application fails to exit if I make an Apollo call. Either through legacy .enqueue / callback or RX2. I have to click the stop button TWICE to exit.
Here are some specifics:
Java: 13
Spring Boot: 2.2.2.RELEASE
plugins {
id 'org.springframework.boot' version '2.2.2.RELEASE'
id 'io.spring.dependency-management' version '1.0.8.RELEASE'
id 'java'
}
sourceCompatibility = '13'
targetCompatibility = '13'
apollo {
suppressRawTypesWarning = true
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web:2.2.2.RELEASE'
implementation 'org.springframework.boot:spring-boot-starter-security:2.2.2.RELEASE'
implementation 'org.springframework.boot:spring-boot-starter-webflux:2.2.2.RELEASE'
implementation 'org.springframework.security:spring-security-oauth2-client:5.2.1.RELEASE'
implementation 'com.google.guava:guava:28.1-jre'
implementation 'com.apollographql.apollo:apollo-runtime:1.2.2'
implementation 'com.apollographql.apollo:apollo-rx2-support:1.2.2'
}
No customizations on either the ApolloClient or the okHttpClient. If I make the call with the okHttpClient directly, the app exits fine.
Call is simply made as (also tried the enqueue callback method):
The text was updated successfully, but these errors were encountered: