Skip to content

spring boot2.1.11 upgrade to spring boot2.2.2 stucked when server setups #19432

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

Closed
sparkcai opened this issue Dec 22, 2019 · 9 comments
Closed
Labels
for: external-project For an external project and not something we can fix

Comments

@sparkcai
Copy link

sparkcai commented Dec 22, 2019

set spring.devtools.restart.enabled=false
thread info below

"main" #1 prio=5 os_prio=0 tid=0x0000000002cdc800 nid=0x36fc waiting on condition [0x0000000002cce000]
   java.lang.Thread.State: WAITING (parking)
        at sun.misc.Unsafe.park(Native Method)
        - parking to wait for  <0x00000000e5f18978> (a java.util.concurrent.CompletableFuture$Signaller)
        at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
        at java.util.concurrent.CompletableFuture$Signaller.block(CompletableFuture.java:1693)
        at java.util.concurrent.ForkJoinPool.managedBlock(ForkJoinPool.java:3323)
        at java.util.concurrent.CompletableFuture.waitingGet(CompletableFuture.java:1729)
        at java.util.concurrent.CompletableFuture.get(CompletableFuture.java:1895)
        at io.lettuce.core.DefaultConnectionFuture.get(DefaultConnectionFuture.java:68)
        at io.lettuce.core.AbstractRedisClient.getConnection(AbstractRedisClient.java:227)
        at io.lettuce.core.RedisClient.connect(RedisClient.java:207)
        at org.springframework.data.redis.connection.lettuce.StandaloneConnectionProvider.lambda$getConnection$1(StandaloneConnectionProvider.java:115)
        at org.springframework.data.redis.connection.lettuce.StandaloneConnectionProvider$$Lambda$829/996955574.get(Unknown Source)
        at java.util.Optional.orElseGet(Optional.java:267)
        at org.springframework.data.redis.connection.lettuce.StandaloneConnectionProvider.getConnection(StandaloneConnectionProvider.java:115)
        at org.springframework.data.redis.connection.lettuce.LettuceConnection.doGetAsyncDedicatedConnection(LettuceConnection.java:1002)
        at org.springframework.data.redis.connection.lettuce.LettuceConnection.getDedicatedConnection(LettuceConnection.java:985)
        at org.springframework.data.redis.connection.lettuce.LettuceConnection.getConnection(LettuceConnection.java:942)
        at org.springframework.data.redis.connection.lettuce.LettuceServerCommands.getConnection(LettuceServerCommands.java:567)
        at org.springframework.data.redis.connection.lettuce.LettuceServerCommands.getConfig(LettuceServerCommands.java:305)
        at org.springframework.data.redis.connection.DefaultedRedisConnection.getConfig(DefaultedRedisConnection.java:1319)
        at org.springframework.session.data.redis.config.ConfigureNotifyKeyspaceEventsAction.getNotifyOptions(ConfigureNotifyKeyspaceEventsAction.java:76)
        at org.springframework.session.data.redis.config.ConfigureNotifyKeyspaceEventsAction.configure(ConfigureNotifyKeyspaceEventsAction.java:57)
        at org.springframework.session.data.redis.config.annotation.web.http.RedisHttpSessionConfiguration$EnableRedisKeyspaceNotificationsInitializer.afterPropertiesSet(RedisHttpSessionConfiguration.java:333)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1855)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1792)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:595)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:517)
        at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:323)
        at org.springframework.beans.factory.support.AbstractBeanFactory$$Lambda$162/1076641925.getObject(Unknown Source)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
        - locked <0x0000000082f3b330> (a java.util.concurrent.ConcurrentHashMap)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:321)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:879)
        at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:878)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:550)
        - locked <0x00000000829b5e70> (a java.lang.Object)
        at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141)
        at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:747)
        at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397)
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:315)
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226)
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1215)
        at com.gpform.UserApplication.main(UserApplication.java:20)
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Dec 22, 2019
@sparkcai sparkcai changed the title spring boot2.1.11 upgrade to spring boot2.2.2 stucked when start server spring boot2.1.11 upgrade to spring boot2.2.2 stucked when server setups Dec 22, 2019
@bclozel
Copy link
Member

bclozel commented Dec 22, 2019

I don't see the link between the devtools configuration, the thread waiting on a redis connection, and the server being stuck a startup.

Could you provide a sample application that replicates this issue?

@bclozel bclozel added the status: waiting-for-feedback We need additional information before we can continue label Dec 22, 2019
@sparkcai
Copy link
Author

This is not related to devtools。 is lettuce always get stuck.
spring boot2.1.x's lettuce version is 5.1.x and spring boot2.2.x‘s lettuce version is 5.2.x.
when i use lettuce version is 5.1.x is ok, but when i use lettuce version is 5.2.x, is stucked.
image

@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue labels Dec 23, 2019
@sparkcai
Copy link
Author

below is debug info,the main thread get stuck here.
debug.txt

@snicoll
Copy link
Member

snicoll commented Dec 23, 2019

This is not related to devtools

Thanks for the feedback but this is a little confusing for us as you've mentioned it explicitly in your original description. We've one more piece of information that you think this is a regression as everything is working fine for you with Spring Boot 2.1.x.

I am afraid the logs and a screenshot doesn't qualify to the sample application @bclozel asked. A zip or a link to a github repo with a small app that we can run ourselves is what we're after. Thank you.

@snicoll snicoll added status: waiting-for-feedback We need additional information before we can continue and removed status: feedback-provided Feedback has been provided labels Dec 23, 2019
@sparkcai
Copy link
Author

sparkcai commented Dec 23, 2019

thanks you all the help . i original think this is about devtools, so, i explicitly disabled devtools. but the main thread always get stuck.

@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue labels Dec 23, 2019
@snicoll snicoll added status: waiting-for-feedback We need additional information before we can continue and removed status: feedback-provided Feedback has been provided labels Dec 23, 2019
@snicoll
Copy link
Member

snicoll commented Dec 23, 2019

@sparkcai alright. We'll resume this one once you've shared the sample we've requested.

@sparkcai
Copy link
Author

sparkcai commented Dec 24, 2019

sample testp.zip
need a redis host
image
if remove zipkin
image
or change to Greenwich both are ok.
<spring-cloud.version>Greenwich.SR4</spring-cloud.version>
<spring-boot.version>2.1.10.RELEASE</spring-boot.version>
thanks @bclozel @snicoll

@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue labels Dec 24, 2019
@snicoll
Copy link
Member

snicoll commented Dec 24, 2019

Thanks for the sample but it looks like from your last comment the issue is Spring Cloud specific. I have removed the Spring Cloud bits from your sample and things are working as expected for me. It looks like adding zipkin leads to the issue so please report this issue with the sample to the zipkin project.

Unrelated but a number of observations on this sample:

  • You can't use @AutoConfigureAfter on a user configuration, this is ignored and doesn't do anything
  • There are a number of deprecated configuration properties in your config, see the hints in your IDE and upgrade them or use spring-boot-properties-migrator to get a report of what needs to be done
  • You don't need to add @EnableAutoConfiguration when @SpringBootApplication is present

@snicoll snicoll closed this as completed Dec 24, 2019
@snicoll snicoll added for: external-project For an external project and not something we can fix and removed status: feedback-provided Feedback has been provided status: waiting-for-triage An issue we've not yet triaged labels Dec 24, 2019
@sparkcai
Copy link
Author

ok, Thanks very much for your advice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
for: external-project For an external project and not something we can fix
Projects
None yet
Development

No branches or pull requests

4 participants