spring-cloud / spring-cloud-netflix

Integration with Netflix OSS components
http://cloud.spring.io/spring-cloud-netflix/
Apache License 2.0
4.86k stars 2.44k forks source link

Open webclient will de-registration failedCannot execute request on any known server #4055

Open k631583871 opened 2 years ago

k631583871 commented 2 years ago

If the following configuration is added to the configuration, Eureka client cannot be closed normally. I think it's because webclientbuilder was not created.

eureka:
  client:
    webclient:
      enabled: true

log:

2021-12-26 14:56:56.597  INFO 502590 --- [ionShutdownHook] c.n.d.s.t.d.RedirectingEurekaHttpClient  : Request execution error. endpoint=DefaultEndpoint{ serviceUrl='http://127.0.0.1:8761/eureka/} exception=event executor terminated; nested exception is java.util.concurrent.RejectedExecutionException: event executor terminated stacktrace=org.springframework.web.reactive.function.client.WebClientRequestException: event executor terminated; nested exception is java.util.concurrent.RejectedExecutionException: event executor terminated
    at org.springframework.web.reactive.function.client.ExchangeFunctions$DefaultExchangeFunction.lambda$wrapException$9(ExchangeFunctions.java:141)
    Suppressed: The stacktrace has been enhanced by Reactor, refer to additional information below: 
Error has been observed at the following site(s):
    *__checkpoint ⇢ Request to DELETE http://127.0.0.1:8761/eureka/apps/CONFIG/192.168.3.101:config [DefaultWebClient]
Original Stack Trace:
        at org.springframework.web.reactive.function.client.ExchangeFunctions$DefaultExchangeFunction.lambda$wrapException$9(ExchangeFunctions.java:141)
        at reactor.core.publisher.MonoErrorSupplied.subscribe(MonoErrorSupplied.java:55)

2021-12-26 14:56:56.598  WARN 502590 --- [ionShutdownHook] c.n.d.s.t.d.RetryableEurekaHttpClient    : Request execution failed with message: event executor terminated; nested exception is java.util.concurrent.RejectedExecutionException: event executor terminated
2021-12-26 14:56:56.600  WARN 502590 --- [ionShutdownHook] c.n.d.s.t.d.RetryableEurekaHttpClient    : Request execution failed with message: Error creating bean with name 'webClientBuilder' defined in class path resource [org/springframework/boot/autoconfigure/web/reactive/function/client/WebClientAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.web.reactive.function.client.WebClient$Builder]: Factory method 'webClientBuilder' threw exception; nested exception is org.springframework.beans.factory.BeanCreationNotAllowedException: Error creating bean with name 'clientConnectorCustomizer': Singleton bean creation not allowed while singletons of this factory are in destruction (Do not request a bean from a BeanFactory in a destroy method implementation!)
2021-12-26 14:56:56.600 ERROR 502590 --- [ionShutdownHook] com.netflix.discovery.DiscoveryClient    : DiscoveryClient_CONFIG/192.168.3.101:config - de-registration failedCannot execute request on any known server

com.netflix.discovery.shared.transport.TransportException: Cannot execute request on any known server
    at com.netflix.discovery.shared.transport.decorator.RetryableEurekaHttpClient.execute(RetryableEurekaHttpClient.java:112) ~[eureka-client-1.10.17.jar:1.10.17]
    at com.netflix.discovery.shared.transport.decorator.EurekaHttpClientDecorator.cancel(EurekaHttpClientDecorator.java:71) ~[eureka-client-1.10.17.jar:1.10.17]

2021-12-26 14:56:56.604  INFO 502590 --- [ionShutdownHook] com.netflix.discovery.DiscoveryClient    : Completed shut down of DiscoveryClient
OlgaMaciaszek commented 2 years ago

Hello @k631583871, thanks for reporting this. I was able to reproduce the issue and will work on a fix.

OlgaMaciaszek commented 1 week ago

Sorry @k631583871, we haven't been able to prioritise this issue yet. Will try to get it in this month.