Skip to content

Spring Boot Actuator endpoint /pause shuts Tomcat application server down #788

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
moritzluedtke opened this issue Jul 13, 2020 · 20 comments
Closed
Labels
Milestone

Comments

@moritzluedtke
Copy link

Describe the bug
We recently upgraded from spring boot 2.1.6.RELEASE to 2.3.1.RELEASE. After that we realized that the endpoint /ops/pause is not functioning any longer. Before it stopped two kafka consumers in our application. Now it seems to also shutdown the spring boot managed tomcat server. After the call we cannot get any requests working. The server refuses any connection after that but the application is still running (no exit codes in the log).

Sample
Don't have one right now but I can create a sample project if it helps.

Workaround
Revert back to 2.1.6.RELEASE as we do not need any of the new features or bug fixes.

More info

  • Java 11
  • Spring Boot 2.3.1.RELEASE

Management related properties in our application.properties:

management.health.status.order=DOWN, UP
management.endpoint.jolokia.enabled=true
management.endpoint.metrics.enabled=true
management.endpoint.pause.enabled=true
management.endpoint.resume.enabled=true
management.endpoint.restart.enabled=true

management.endpoints.web.exposure.include=*
management.endpoints.web.base-path=/ops

The log after calling /ops/pause:

2020-07-13 11:55:15,347 [http-nio-31016-exec-2] traceId=3b2fc7d64f4e0d82 spanId=3b2fc7d64f4e0d82 INFO  o.a.coyote.http11.Http11NioProtocol - Pausing ProtocolHandler ["http-nio-31016"]
2020-07-13 11:55:15,355 [http-nio-31016-exec-2] traceId=3b2fc7d64f4e0d82 spanId=3b2fc7d64f4e0d82 INFO  o.a.catalina.core.StandardService - Stopping service [Tomcat]
2020-07-13 11:55:15,357 [http-nio-31016-exec-2] traceId=3b2fc7d64f4e0d82 spanId=3b2fc7d64f4e0d82 INFO  o.a.catalina.core.StandardWrapper - Waiting for [1] instance(s) to be deallocated for Servlet [dispatcherServlet]
2020-07-13 11:55:16,363 [http-nio-31016-exec-2] traceId=3b2fc7d64f4e0d82 spanId=3b2fc7d64f4e0d82 INFO  o.a.catalina.core.StandardWrapper - Waiting for [1] instance(s) to be deallocated for Servlet [dispatcherServlet]
2020-07-13 11:55:17,389 [http-nio-31016-exec-2] traceId=3b2fc7d64f4e0d82 spanId=3b2fc7d64f4e0d82 INFO  o.a.catalina.core.StandardWrapper - Waiting for [1] instance(s) to be deallocated for Servlet [dispatcherServlet]
2020-07-13 11:55:17,493 [http-nio-31016-exec-2] traceId=3b2fc7d64f4e0d82 spanId=3b2fc7d64f4e0d82 INFO  o.a.c.c.C.[Tomcat].[localhost].[/] - Destroying Spring FrameworkServlet 'dispatcherServlet'
2020-07-13 11:55:17,500 [http-nio-31016-exec-2] traceId=3b2fc7d64f4e0d82 spanId=3b2fc7d64f4e0d82 INFO  o.a.coyote.http11.Http11NioProtocol - Stopping ProtocolHandler ["http-nio-31016"]
2020-07-13 11:55:17,503 [http-nio-31016-exec-2] traceId=3b2fc7d64f4e0d82 spanId=3b2fc7d64f4e0d82 WARN  o.apache.tomcat.util.net.NioEndpoint - The executor associated with thread pool [http-nio-31016] has not fully shutdown. Some application threads may still be running.
2020-07-13 11:55:17,504 [http-nio-31016-exec-2] traceId=3b2fc7d64f4e0d82 spanId=3b2fc7d64f4e0d82 INFO  o.a.coyote.http11.Http11NioProtocol - Destroying ProtocolHandler ["http-nio-31016"]
2020-07-13 11:55:17,542 [http-nio-31016-exec-2] traceId= spanId= ERROR o.a.c.c.C.[.[.[.[dispatcherServlet] - Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception
java.lang.NullPointerException: null
	at java.base/java.util.Objects.requireNonNull(Objects.java:221)
	at io.micrometer.core.instrument.ImmutableTag.<init>(ImmutableTag.java:35)
	at io.micrometer.core.instrument.Tag.of(Tag.java:29)
	at org.springframework.boot.actuate.metrics.web.servlet.WebMvcTags.method(WebMvcTags.java:74)
	at org.springframework.boot.actuate.metrics.web.servlet.DefaultWebMvcTagsProvider.getTags(DefaultWebMvcTagsProvider.java:74)
	at org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter.getTimer(WebMvcMetricsFilter.java:169)
	at org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter.record(WebMvcMetricsFilter.java:129)
	at org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter.doFilterInternal(WebMvcMetricsFilter.java:105)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
	at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:373)
	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868)
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1590)
	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.base/java.lang.Thread.run(Thread.java:834)
2020-07-13 11:55:17,546 [http-nio-31016-exec-2] traceId= spanId= ERROR o.a.coyote.http11.Http11Processor - Error processing request
java.lang.NullPointerException: null
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:412)
	at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:373)
	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868)
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1590)
	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.base/java.lang.Thread.run(Thread.java:834)
2020-07-13 11:55:17,547 [http-nio-31016-exec-2] traceId= spanId= WARN  o.a.catalina.connector.CoyoteAdapter - Exception while attempting to add an entry to the access log
java.lang.NullPointerException: null
	at org.apache.catalina.connector.CoyoteAdapter.log(CoyoteAdapter.java:490)
	at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:403)
	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868)
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1590)
	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.base/java.lang.Thread.run(Thread.java:834)

@moritzluedtke
Copy link
Author

moritzluedtke commented Jul 13, 2020

A colleague of mine found out that in the method DefaultLifecycleProcessor#getLifecycleBeans() all beans are collected which will be shut down. If you call the mentioned actuator endpoint the list of beans is the following for us:

  • documentationPluginsBootstrapper
  • org.springframework.kafka.config.internalKafkaListenerEndpointRegistry
  • webServerGracefulShutdown
  • webServerStartStop

@moritzluedtke moritzluedtke changed the title Spring Boot Actuator endpoint /ops/pause seems to shutdown Tomcat server Spring Boot Actuator endpoint /ops/pause seems to shut down Tomcat server Jul 13, 2020
@ryanjbaxter
Copy link
Contributor

Would you mind creating a sample app so we can take a look?

@moritzluedtke
Copy link
Author

moritzluedtke commented Jul 14, 2020

Sure, no problem:
https://github.com/moritzluedtke/spring-actuator-problem

I could not reproduce the NPE. We assume that the service wanted to write something to the logs but the tomcat was already in shut down mode and the log was no longer available. When it worked, the service logged that the Kafka consumers were stopped. So that is probably the message it wants to log and I don't have any Kafka integration in the sample project.

But you can see how the /pause command takes down the tomcat and the application.

We also did a bunch of testing and found out that this started to happen with spring boot version 2.3.0.RELEASE. The spring-cloud-dependencies did not seem to affect this issue as it appears in both Greenwich.SR2 and Hoxton.SR6.

Edit:
I did ask this question over in the spring boot project but was forwarded to you.
(spring-projects/spring-boot#22315)

This is the log with the sample project (at timestamp 09:25:48.261 I called /pause):

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::        (v2.3.1.RELEASE)

2020-07-16 09:25:21.037  INFO [test,,,] 3722 --- [           main] c.e.a.ActuatorDemoApplication            : The following profiles are active: dev
2020-07-16 09:25:21.629  INFO [test,,,] 3722 --- [           main] o.s.cloud.context.scope.GenericScope     : BeanFactory id=e161ade0-a617-396f-acad-a3e1e19f088a
2020-07-16 09:25:21.812  INFO [test,,,] 3722 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration' of type [org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration$$EnhancerBySpringCGLIB$$fcea6e0d] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-07-16 09:25:22.020  INFO [test,,,] 3722 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 8001 (http)
2020-07-16 09:25:22.026  INFO [test,,,] 3722 --- [           main] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
2020-07-16 09:25:22.026  INFO [test,,,] 3722 --- [           main] org.apache.catalina.core.StandardEngine  : Starting Servlet engine: [Apache Tomcat/9.0.36]
2020-07-16 09:25:22.091  INFO [test,,,] 3722 --- [           main] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
2020-07-16 09:25:22.091  INFO [test,,,] 3722 --- [           main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 1045 ms
2020-07-16 09:25:22.769  INFO [test,,,] 3722 --- [           main] o.s.s.concurrent.ThreadPoolTaskExecutor  : Initializing ExecutorService 'applicationTaskExecutor'
2020-07-16 09:25:23.112  INFO [test,,,] 3722 --- [           main] o.s.b.a.e.web.EndpointLinksResolver      : Exposing 18 endpoint(s) beneath base path '/ops'
2020-07-16 09:25:23.199  INFO [test,,,] 3722 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port(s): 8001 (http) with context path ''
2020-07-16 09:25:23.214  INFO [test,,,] 3722 --- [           main] c.e.a.ActuatorDemoApplication            : Started ActuatorDemoApplication in 2.662 seconds (JVM running for 3.494)
2020-07-16 09:25:23.425  INFO [test,,,] 3722 --- [on(2)-127.0.0.1] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring DispatcherServlet 'dispatcherServlet'
2020-07-16 09:25:23.425  INFO [test,,,] 3722 --- [on(2)-127.0.0.1] o.s.web.servlet.DispatcherServlet        : Initializing Servlet 'dispatcherServlet'
2020-07-16 09:25:23.435  INFO [test,,,] 3722 --- [on(2)-127.0.0.1] o.s.web.servlet.DispatcherServlet        : Completed initialization in 10 ms
2020-07-16 09:25:48.261  INFO [test,f5391faceb6c39e0,f5391faceb6c39e0,false] 3722 --- [nio-8001-exec-2] o.apache.catalina.core.StandardService   : Stopping service [Tomcat]
2020-07-16 09:25:48.262  INFO [test,f5391faceb6c39e0,f5391faceb6c39e0,false] 3722 --- [nio-8001-exec-2] o.apache.catalina.core.StandardWrapper   : Waiting for [1] instance(s) to be deallocated for Servlet [dispatcherServlet]
2020-07-16 09:25:49.300  INFO [test,f5391faceb6c39e0,f5391faceb6c39e0,false] 3722 --- [nio-8001-exec-2] o.apache.catalina.core.StandardWrapper   : Waiting for [1] instance(s) to be deallocated for Servlet [dispatcherServlet]
2020-07-16 09:25:50.330  INFO [test,f5391faceb6c39e0,f5391faceb6c39e0,false] 3722 --- [nio-8001-exec-2] o.apache.catalina.core.StandardWrapper   : Waiting for [1] instance(s) to be deallocated for Servlet [dispatcherServlet]
2020-07-16 09:25:50.433  INFO [test,f5391faceb6c39e0,f5391faceb6c39e0,false] 3722 --- [nio-8001-exec-2] o.a.c.c.C.[Tomcat].[localhost].[/]       : Destroying Spring FrameworkServlet 'dispatcherServlet'
2020-07-16 09:25:50.440  WARN [test,f5391faceb6c39e0,f5391faceb6c39e0,false] 3722 --- [nio-8001-exec-2] org.apache.tomcat.util.net.NioEndpoint   : The executor associated with thread pool [http-nio-8001] has not fully shutdown. Some application threads may still be running.
2020-07-16 09:25:50.444  INFO [test,,,] 3722 --- [extShutdownHook] o.s.s.concurrent.ThreadPoolTaskExecutor  : Shutting down ExecutorService 'applicationTaskExecutor'

Process finished with exit code 0

@moritzluedtke moritzluedtke changed the title Spring Boot Actuator endpoint /ops/pause seems to shut down Tomcat server Spring Boot Actuator endpoint /pause shuts Tomcat application server down Jul 16, 2020
@moritzluedtke
Copy link
Author

Did anyone had a chance to take a look at this?

@moritzluedtke
Copy link
Author

moritzluedtke commented Aug 10, 2020

This behaviour is still present in spring-boot 2.3.3.

@olagache
Copy link

olagache commented Aug 26, 2020

Same issue for me.
Calling /actuator/pause return no awswer. Connection is closed before ...

curl -i -X POST    -H "Authorization:Bearer xxxxxxx"  'http://localhost:48880/actuator/pause'
--> curl: (52) Empty reply from server

Unable to call resume ,info or health after pause

curl -i -X POST    -H "Authorization:Bearer xxxxxxx"  'http://localhost:48880/actuator/resume'
--> curl: (7) Failed to connect to localhost port 48880: Connexion refusée

In discovery application, the paused service is marked as down and the PID (with ps command) is present.

@olagache
Copy link

olagache commented Sep 8, 2020

@moritzluedtke : No news ?

@moritzluedtke
Copy link
Author

moritzluedtke commented Sep 14, 2020

Hey @olagache,

I'm only the reporter of this issue. I am not involved in the development of the spring framework or it's dependent projects.

So I guess we'll have to wait for an answer from the devs of this project.

@spencergibb
Copy link
Member

Pause simple calls this.context.stop() where context is the spring application context. Boot may have changed things enough that pause no longer works. @dsyer thoughts?

@spencergibb
Copy link
Member

Looks like we need to have a broader conversation with the boot team. @philwebb did graceful shutdown change the behavior of servlet containers to use lifecycle methods to shut down? There are use cases where stopping the context is valid while keeping the app up. /cc @garyrussell @olegz

@wilkinsona
Copy link
Contributor

Did graceful shutdown change the behavior of servlet containers to use lifecycle methods to shut down

Yes, the change to integrate with the context lifecycle was made based on user feedback on 2.3 RC1. See spring-projects/spring-boot#21325 for some details.

@mkieloch-352
Copy link

Any updates on this from the Spring Boot team? This change is causing our deployment flow to fail since we rely on the endpoints to pause the application and allow to drain prior to deployment.

@wilkinsona
Copy link
Contributor

@mk352, I'm a member of the Boot team.

@mkieloch-352
Copy link

@wilkinsona Was this implemented by design or is this a bug? I'm currently using V2.3.2 and wondering if I should revert until this is resolved.

@wilkinsona
Copy link
Contributor

It is by design. As I said above, the change was made following user feedback on 2.3 RC1. Basing graceful shutdown on the application context's lifecycle allows other components to participate in the shutdown, something which was not possible previously.

I'd argue that it's correct that the application should stop accepting requests when it has been paused. IMO, the problem is really that pause either results in the application exiting (if there are no non-daemon threads left running) or not being able to make a resume request over HTTP. It may be possible to circumvent the latter by using JMX.

@garyrussell
Copy link

Pause simpl[y] calls this.context.stop()

That doesn't seem right to me; pause is a first class concept for Kafka consumers - keep the consumer alive but don't consume any records.

Containers for @KafkaListeners can be paused/resumed using the KafkaListenerEndpointRegistry.

this.listenerRegistry.getListenerContainers().forEach(cont -> cont.pause());

Spring Integration components implement Pausable which is a sub-interface of LifeCycle.

Spring Cloud Stream has an endpoint for pausing/resuming consumer bindings.

@dsyer
Copy link
Contributor

dsyer commented Nov 12, 2020

Seems like we need to fix this endpoint in Spring Cloud Commons. It probably should have an extension point that can be implemented for the various flavours above and dropped into conditional autoconfigurations. Spring Cloud Stream shouldn't (IMO) have its own endpoint for this, since the whole reason for the Commons one to exist was to provide that functionality, so it should probably deprecate it and provide some autoconfiguration for the hook that we provide. Or maybe it wouldn't need to if all it is doing is calling Pausable.pause() because that's generic enough that Commons can do it (at the expense of one more optional dependency).

@moritzluedtke
Copy link
Author

moritzluedtke commented Nov 12, 2020

I agree that a paused application should not accept requests but I disagree that it should be completely shut down. That is not something I would expect from the word pause. If I want it to shutdown I should call /actuator/shutdown, right?

As @garyrussell already said this is used with Kafka and that is the way we use it in our deployment pipelines, too.
Pause the consumers, so that every message was consumed normally and nothing gets lost. Then kill the application and deploy a new one.

@wilkinsona
Copy link
Contributor

but I disagree that it should be completely shut down

I don't think anyone's arguing that's what should happen. The current implementation relies upon the web container's request-handling threads to keep the JVM alive during the pause. If it wants to be certain that the JVM will remain alive while everything has been paused, it needs to ensure that a non-daemon thread that it controls is alive for the duration of the pause.

@dsyer
Copy link
Contributor

dsyer commented Nov 12, 2020

If you want to "kill the application and deploy a new one" @moritzluedtke then I would argue that /shutdown is the correct endpoint. The current behaviour of /pause is wrong (in fact it has always been wrong, but this new graceful sutdown feature in Boot has only just now made us notice), so the idea is to fix it.

dsyer pushed a commit that referenced this issue Dec 1, 2020
A new interface PauseHandler provides a callback for /pause and
/resume. The only implementation provided out of the box is for
Spring Integration's Pausable (so it will work with Spring Cloud
Stream Kafka for instance).

Fixes gh-788
@dsyer dsyer added this to the 2.2.7.RELEASE milestone Dec 1, 2020
@dsyer dsyer closed this as completed Dec 1, 2020
dsyer pushed a commit that referenced this issue Dec 1, 2020
A new interface PauseHandler provides a callback for /pause and
/resume. The only implementation provided out of the box is for
Spring Integration's Pausable (so it will work with Spring Cloud
Stream Kafka for instance).

Fixes gh-788
roboslyq added a commit to roboslyq/spring-cloud-commons that referenced this issue Dec 30, 2020
* Bumping versions

* removes unused files

* Moves integration tests to separate package

* fixes ordering

* fixes description

* Forces web-application-type=none in ContextRefresher.

This allows apps with spring.main.web-application-type={REACTIVE|SERVLET} to function properly without error.

fixes spring-cloudgh-678

* formatting

* Removes inadvertant copied file

* Make LoadBalancerClientFactory bean conditional on missing bean. (spring-cloud#679)

* Bumping versions

* fix double checked locking with volatile (spring-cloud#649)

* Changes default value of management.endpoint.env.post.enabled to false.

fixes spring-cloudgh-681

* Fix gh 629 new (spring-cloud#683)

* Swaps deprecated ConditionalOnEnabledEndpoint for updated annotation.

Swaps with ConditionalOnAvailableEndpoint

* Migrates to new OutputCaptureRule

* Migrates to new OutputCaptureRule

* Add health check loadBalancing implementation.

* Make isAlive() method protected.

Co-authored-by: Spencer Gibb <spencer@gibb.tech>

* Fix warning wording.

* Add info on SimpleDiscoveryClient in the docs. Remove redundant param. (spring-cloud#684)

* Add info on SimpleDiscoveryClient in the docs. Remove redundant parameter.

* Remove warning after discussion.

* Allow overriding ReactorLoadBalancerExchangeFilterFunction.

* Allow overriding choose(String serviceId) method.

* Remove ribbon integration (spring-cloud#691)

* Remove Ribbon-specific configuration.

* Remove Ribbon-specific docs. Refactor.

* Move BootstrapPropertySource to its own class and expose delegate PropertySource via getter (spring-cloud#695)

* Making constructor public

* Fixes issues in HealthCheckServiceInstanceListSupplier (spring-cloud#685)

- WebClient response leaks
- potential Scheduled task leak
- rework polling to plain reactor operators
- remove non atomic operations on ServiceInstance lists

related to spring-cloudgh-629
fixes issues from spring-cloudgh-683

* formatting

* Updates javadoc to mention WebClient.

fixes spring-cloudgh-645

* Pass SimpleDiscoveryProperties as parameter.

18a4227 turned proxying off which broke this.

fixes spring-cloudgh-687

* formatting

* Ensures HikariDataSource is never re-bound.

Removes HikariDataSource from extra-refreshable and adds it to a new property never-refreshable.

ConfigurationPropertiesRebinder now checks that property and does not rebind beans whose class is in never-refreshable.

fixes spring-cloudgh-687

* Update SNAPSHOT to 2.2.2.RELEASE

* Going back to snapshots

* Bumping versions to 2.2.3.BUILD-SNAPSHOT after release

* Bumping versions

* Increase timeout for CI tests

* formatting

* Updates ContextRefresher to maintain property source ordering. (spring-cloud#705)

Updates the targetName so that property sources maintain ordering from the bootstrap environment where they were refreshed.

Fixes spring-cloudgh-704

* Typo correction in document (spring-cloud#708)

Co-authored-by: jinsoohan <jinsoo.han@gmail.com>

* Removes references to Hystrix

* Increase timeout for CI tests

* Adds reconstructURI method to ReactorLoadBalancerExchangeFilterFunction

fixes spring-cloudgh-711

* Minor refactoring to adjust to team conventions.

* Adds boot 2.3 compatiblity

* Bumps to build 2.2.4.BUILD-SNAPSHOT

* Updates compatible versions to 2.2.x and 2.3.x

see spring-cloud/spring-cloud-build#153

* Verifies current boot version is in CompatibilityVerifierProperties.

Also fixes support for wildcard 2.2.x beyond boot 2.1.x

fixes spring-cloudgh-715

* Updates ilford boot compatibility

* Bumps to build 2.3.0.BUILD-SNAPSHOT

* Bumping versions

* Ignores flaky test.

See gh-1627

* Fixes issue

* Ignores failing test because of old boot version.

see spring-cloudgh-717

* try to fix flaky test (spring-cloud#718)

fixes spring-cloudgh-716

* fix Endpoint ID 'service-registry' contains invalid characters, please migrate to a valid format (spring-cloud#701)

* Add a property source that produces a random value that is cached (spring-cloud#719)

* Add a property source that produces a random value that is cached.

* Updated docs

* Cherry picking commit 4119a9c

* Add utility method to provide a service if to IdUtils (spring-cloud#721)

* Update SNAPSHOT to 3.0.0.M1

* Going back to snapshots

* Bumping versions

* Changing default value to be false.  Fixes spring-cloud#738

* spring-cloud#738 (spring-cloud#740)

The default value for management.endpoint.env.post.enabled should be false instead of true.

* Update license comments.

* Update license comments.

* Fix docs on Instance Health-Check for LoadBalancer. Fixes spring-cloudgh-746.

* spring-cloud-loadbalancer add additional-spring-configuration-metadata.json

# Conflicts:
#	spring-cloud-loadbalancer/src/main/resources/META-INF/additional-spring-configuration-metadata.json

* Fix capitalisation.

* Lb configuration builders (spring-cloud#751)

* Adds ServiceInstanceListSuppliers.java with Builder

* Implement TODOs.

* Add javadocs.

* Remove unused type.

* Add test.

* Safer caching config: resolve LoadBalancerCacheManager lazily. Return delegate if LoadBalancerCacheManager not available.

* Switch to using builder in LoadBalancerClientConfiguration.

* Autoformatting with spring-java-format.

* Update docs.

Co-authored-by: Spencer Gibb <spencer@gibb.us>

* ignores .sdkmanrc

* Stops casting RandomPropertySource.

This avoids casting errors if property sources are wrapped.

Fixes spring-cloudgh-757

* Add predefined ServiceInstanceListSupplier configurations. 2nd part of spring-cloudgh-741. (spring-cloud#758)

* Removes deprecated ServiceInstanceSupplier

Fixes spring-cloudgh-753

* Renames ServiceInstanceListSuppliers to ServiceInstanceListSupplierBuilder (spring-cloud#761)

Puts static builder() method on ServiceInstanceListSupplier.

Deprecates ServiceInstanceListSupplier.fixed(Environment) and replaces with fixed(serviceId).

* Adds support for non-enumerable property sources in bootstrap.

Fixes spring-cloudgh-724

* Renames ServiceInstanceListSuppliers to ServiceInstanceListSupplierBuilder (spring-cloud#761)

Puts static builder() method on ServiceInstanceListSupplier.

Deprecates ServiceInstanceListSupplier.fixed(Environment) and replaces with fixed(serviceId).

* Adds ConditionalOnMissingBean to SimpleDiscoveryProperties.

Fixes spring-cloudgh-759
Fixes spring-cloudgh-762

* Bumping versions

* Setting up repository for docs.spring.io migration

* Setting up repository for docs.spring.io migration

* Gh 760 health check with cache new (spring-cloud#765)

* Cache first element of service instance list flux.

* Invoke destroy() and afterPropertiesSet() in non-bean ServiceInstanceListSupplier delegates.

* Fix return updated instances.

* Fix return updated instances.

* Gh 760 health check with cache new (spring-cloud#765)

* Cache first element of service instance list flux.

* Invoke destroy() and afterPropertiesSet() in non-bean ServiceInstanceListSupplier delegates.

* Fix return updated instances.

* Fix return updated instances.

(cherry picked from commit 88b2f0e)

* Bumping versions

* Fix execution thread for blocking and adjusts timing

* Fix execution thread for blocking DiscoveryClientServiceInstanceListSupplier.

* Desynchronise HealthCheck and Cache. Add info about using HealthCheck without Cache to docs.

See spring-cloudgh-760

* Handle exceptions and timeouts new (spring-cloud#767)

* Handle timeouts and exceptions while retrieving instances.

* Update docs.

* Switch initialDelay to Duration. (spring-cloud#768)

* Update README.

* Bumping versions

* Update SNAPSHOT to 2.2.3.RELEASE

* Going back to snapshots

* Bumping versions to 2.2.4.BUILD-SNAPSHOT after release

* Update SNAPSHOT to 3.0.0-M2

* Going back to snapshots

* Fix property name in docs.

* Migrated to docs.spring.io & updated sc-build

* Bumping versions

* Uploading sources for docs

* Changed packaging to jar

* Bumping versions

* Adds junit-vintage-engine

* Move Request and Response to loadbalancer package. Fixes spring-cloudgh-772. (spring-cloud#773)

* Move Request and Response to loadbalancer package. Fixes spring-cloudgh-772.

* Fix checkstyle.

* Inherit and reference repackaged classes.

* Revert "Inherit and reference repackaged classes."

This reverts commit 02808c5.

* Fix Status enums.

* Make old classes extend the new ones.

* Remove deprecated Request and Response classes. (spring-cloud#779)

* Avoid field autowiring in SimpleDiscoveryClientAutoConfiguration (spring-cloud#786)

In order to fix GraalVM compatibility

* Avoid field autowiring in SimpleDiscoveryClientAutoConfiguration (spring-cloud#786)

In order to fix GraalVM compatibility

* Lb complete lifecycle (spring-cloud#783)

* Add LoadBalancerLifecycle. Trigger lifecycle callbacks. Set hints from properties.

* Trigger LB lifecycle callbacks from BlockingLoadBalancerClient and RetryLoadBalancerInterceptor.

* Register LifecycleProcessors with @LoadBalancerClients

* Register LifecycleProcessors with @LoadBalancerClients configuration.

* Handle null lifecycle beans map returned from factory. Adjust tests to code changes.

* Handle null lifecycle beans map returned from factory in RetryLoadBalancerInterceptor. Ensure ReactiveLoadBalancer.Factory bean is present while instantiating RetryLoadBalancerInterceptor. Add more tests.

* Remove generics from supports(...) method signature.

* Allow setting hint per service via properties.

* Add some toString() methods. Add more info on deprecated callbacks in javadocs and comments.

* Add javadocs.

* Format javadocs. Add docs.

* Update hint docs.

* Fix docs.

* Fix docs.

* Extract filtering supported lifecycle processors to a separate class; Execute onComplete() calls for DISCARD status in RetryLoadBalancerInterceptor. Remove duplicated `onComplete` calls for FAILED and SUCCESS status in RetryLoadBalancerInterceptor. Add test for no duplicated lifecycle calls in RetryLoadBalancerInterceptorTest.

* Small refactoring: remove deprecated methods use, add final keywords, remove unnecessary keywords.

* Add javadoc.

* Bumping versions

* Update SNAPSHOT to 3.0.0-M3

* Going back to snapshots

* Mock property source name

* Disables failing test.

See spring-cloudgh-802

* Update SNAPSHOT to 2.2.4.RELEASE

* Going back to snapshots

* Bumping versions to 2.2.5.BUILD-SNAPSHOT after release

* Fixes s-c-build version to snapshot

* Use new boot ConfigData framework (spring-cloud#703)

Bootstrap is now opt-in using `spring.config.use-legacy-processing`. Otherwise, bootstrap is left as is.

If bootstrap is disabled, the `ContextRefresher` uses new `ConfigData` framework from boot.

See spring-cloud#608 for original motivation.

* Replaces usage of ConfigFileApplicationListener with a subclass.

BootstrapConfigFileApplicationListener.java overrides the onApplicationEvent() method to not throw an exception.

* Updates to use new ConfigDataEnvironmentPostProcessor.applyTo() method

* Adds spring-cloud-starter-bootstrap.

This allows users to opt-in to bootstrap via classpath rather than properties.

* Formatting

* Updates to use repo.spring.io/snapshot

* Subscribe on flux earlier. Fixes spring-cloudgh-802.

* Updates to use new BootstrapRegistry for ConfigData

* Setting reactor bom to 2020.0.0-SNAPSHOT due to reactor bom overriding in HATEOAS

* add common classes for TLS properties (spring-cloud#803)

* add common classes for TLS test

* Revert "add common classes for TLS test"

This reverts commit 7f5d076.

* add common tls properties

* add unit tests for tls properties

* Removes dependency management for okhttp3 and httpclient

These are managed by boot.

Fixes spring-cloudgh-813

* Bumping versions

* Update SNAPSHOT to 2.2.5.RELEASE

* Going back to snapshots

* Bumping versions to 2.2.6.BUILD-SNAPSHOT after release

* Make HATEOAS properly optional

* Bumping versions

* Performance improvements to NamedContextFactory. (spring-cloud#826)

Fixes spring-cloudgh-825

* Compatibility check if Spring Boot version is unknown

It is better not to fail the compatibility check if the Spring Boot version is unknown.

* Adjust to updates in boot.

* Reformat.

* Add retry support for blocking LoadBalancer (spring-cloud#832)

* Add LoadBalancerProperties and BlockingLoadBalancedRetryPolicy. Add spring-retry dependency in LoadBalancer.

* Add BlockingLoadBalancedRetryFactory

* Move retry properties to LoadBalancerRetryProperties.

* Refactor and remove deprecations, fix checkstyle.

* Add BlockingLoadBalancedRetryPolicy to autoconfiguration. Set default retryableStatusCode prop. Fix javadoc.

* Allow using @order on LoadBalancedRetryFactory beans.

* Add tests. Reformat tests. Add explanatory comments.

* Add documentation.

* Fix javadoc.

* Fix docs after review.

* Change field name.

* Wording changes (spring-cloud#784)

Replacing some terms

* Updating Evictor Project link

* Avoid retrying on same instance (spring-cloud#834)

* cherry-pick switching to properties

* Pass information on previous ServiceInstance to RequestContext.

# Conflicts:
#	spring-cloud-loadbalancer/src/main/java/org/springframework/cloud/loadbalancer/blocking/retry/BlockingLoadBalancedRetryPolicy.java

* Add a RoundRobinLoadBalancer implementation that avoids same service instance while retrying.

* Wrap instances in ArrayList. Add tests.

* Enable AvoidPreviousInstanceRoundRobinLoadBalancer by default if SpringRetry on classpath.

* Fix failing tests. Add javadocs and author tags.

* Fix properties.

* Add documentation.

* Fix docs after review.

* Fix docs after review.

* Handle avoiding previous instance with ServiceInstanceListSupplier in place of LoadBalancer.

* Fix property name.

* Change spelling.

* Add more logs.

* Remove URL check that causes loading 401 responses from Spring Cloud Config

* Override equals(), hashCode() and toString() in DefaultRequest and DefaultRequestContext.

* Add equals(), hashCode() and toString() methods to HintRequestContext and RetryableRequestContext.

* Revert "Setting reactor bom to 2020.0.0-SNAPSHOT due to reactor bom overriding in HATEOAS"

This reverts commit 6ea0b47.

* Update SNAPSHOT to 3.0.0-M4

* Going back to snapshots

* Deprecates SimpleServiceInstance in favor of DefaultServiceInstance (spring-cloud#835)

* Initial Commit

* Added URI to DefaultServiceInstance

* Added default constructor

* Fixed PR Comments

* Adjust after PR merge. Minor refactoring.

* Bumping versions

* Ignored a test; added conditional on property

* Update SNAPSHOT to 2.2.6.RELEASE

* Going back to snapshots

* Bumping versions to 2.2.7.BUILD-SNAPSHOT after release

* Add Reactive retries for SC LoadBalancer (spring-cloud#847)

* Implement retry logic.

* Fix retrying on next instance when RetryExhausted in same instance.

* Fix retrying on next instance when RetryExhausted in same instance.

* Fix retrying on next instance when RetryExhausted in same instance.

* Move duplicated methods to utility class. Fix checkstyle.

* Fix test.

* Add more tests.

* Fix test.

* Add autoConfiguration.

* Refactor and add javadocs.

* Add javadocs.

* Use RetryAwareServiceInstanceListSupplier with reactive retries.

* Update properties.

* Fix the docs.

* Rename utility class.

* Verify interactions in order.

* Remove LB caching from default health-check config, since HealthCheckServiceInstanceListSupplier has a separate caching mechanism. Fixes spring-cloudgh-849.

* Bumping versions

* Move properties to parameter.

Fixes spring-cloudgh-850

* formatting

* Bumping versions

* Update SNAPSHOT to 3.0.0-M5

* Going back to snapshots

* Bumping versions

* Re-implement /pause endpoint

A new interface PauseHandler provides a callback for /pause and
/resume. The only implementation provided out of the box is for
Spring Integration's Pausable (so it will work with Spring Cloud
Stream Kafka for instance).

Fixes spring-cloudgh-788

* Allow refetching instances for healthcheck (spring-cloud#855)

* Allow refetching instances by HealthCheckServiceInstanceListSupplier.

* Add docs and javadocs.

* Fix docs after review.

* Add ServerHttpRequestContext. (spring-cloud#857)

* Update SNAPSHOT to 3.0.0-M6

* Going back to snapshots

* Support same service instance preference (spring-cloud#862)

* Draft initial implementation.

* Rename default configuration property. Check previously chosen instance for equality.

* Verify previous service instance for null. Add tests.

* Add docs.

* Add javadocs.

* Fix javadocs after review.

* Fix @SInCE info.

* Request based sticky session (spring-cloud#860)

* Implement first draft for sticky-session load-balancing.

* Make setting instance cookie opt-in.

* Add tests.

* Make adding request cookie opt-in.

* Add docs and javadocs.

* Add default configuration with blocking discovery client.

* Fix docs after review.

* Do not pass response body to LB lifecycle beans. (spring-cloud#864)

* Do not pass response body to LB lifecycle beans.

* Fix argument name.

* Fix generics.

* Add HttpServerRequest-based constructor to RequestData. (spring-cloud#865)

* Add HttpServerRequest-based constructor to RequestData. Add HttpServerResponse-based constructor to ResponseData.

* Also get request cookies from headers.

* Handle cookie pattern not found.

* Fix adding cookie.

* Fix adding cookies. Update docs.

* Remove deprecations.

* Move LoadBalancerProperties to the parent package.

* Add function-based health check. Add restTemplate-based health-check beans to default config (spring-cloud#866)

* Switch to a function-based HealthCheckServiceInstanceListSupplier.

* Handle exception for restTemplate based function. Add default blocking health-check configuration.

* Add docs.

* Add RandomLoadBalancer, along with tests and docs. (spring-cloud#868)

# Conflicts:
#	spring-cloud-loadbalancer/src/main/java/org/springframework/cloud/loadbalancer/core/RoundRobinLoadBalancer.java

* Fix after merge.

* Update SNAPSHOT to 3.0.0-RC1

* Going back to snapshots

* Bumping versions

* Moves classes from spring-cloud-security to spring-cloud-commons

* Lb micrometer stats (spring-cloud#871)

* Add stats lifecycle bean. Add onStartRequest method to LoadBalancerLifecycle. Add loadbalancer.Request field to CompletionContext.

* Add TimedRequestContext interface. Make RetryableRequestContext extend RequestDataContext. Improve generating metrics. Add utility class for working with tags. Ensure tags are not null.

* Add separate meters depending on CompletionContext.Status.

* Modify registered metrics. Add adapter for BlockingLoadBalancerClient requests. Add autoconfiguration.

* Make new config conditional on MeterRegistry class.

* Rename lifecycle bean. Do not log request if 0 timestamp.

* Fix onStartRequest call arguments for BlockingLoadBalancerClient.

* Fix onStartRequest and onComplete calls for RetryLoadBalancerInterceptor.

* Only register timed request once. Add tests.

* Adjust tags logic. Add more tests.

* Add more tests.

* Refactor. Add javadocs.

* Refactor.

* Refactor.

* Retrieve client response data if possible in BlockingLoadBalancerClient.

* Refactor.

* Fix docs after review.

* Make previousServiceInstanceMutable.

* Change argument order for CompletionContext constructors. Remove duplicated start time setting.

* Add missing LB properties to configuration-metadata.

* making getDiscoveryClients public in ReactiveCompositeDiscoveryClient

* Creates TextEncryptorBindHandler for Binder decryption.

It is registered in TextEncryptorConfigBootstrapper for later use in
other ConfigData implementations.

* Creates DecryptEnvironmentPostProcessor.

This is used if bootstrap and legacy processing are not enabled.

EnvironmentDecryptApplicationInitializer is only is if bootstrap and legacy processing are enabled.

Fixes spring-cloudgh-815

* Update SNAPSHOT to 3.0.0

* Going back to snapshots

* Bumping versions to 3.0.1-SNAPSHOT after release

* Bumping versions

Co-authored-by: Ryan Baxter <rbaxter@pivotal.io>
Co-authored-by: buildmaster <buildmaster@springframework.org>
Co-authored-by: Spencer Gibb <spencer@gibb.us>
Co-authored-by: Olga Maciaszek-Sharma <olga.maciaszek@gmail.com>
Co-authored-by: shenjianeng <30279020+shenjianeng@users.noreply.github.com>
Co-authored-by: Spencer Gibb <spencer@gibb.tech>
Co-authored-by: robotmrv <robotmrv@gmail.com>
Co-authored-by: JinSoo Han <hahahohokiss@gmail.com>
Co-authored-by: jinsoohan <jinsoo.han@gmail.com>
Co-authored-by: Timothy <timothy.mathison96@gmail.com>
Co-authored-by: Nikita Konev <3160384+nkonev@users.noreply.github.com>
Co-authored-by: Marcin Grzejszczak <marcin.grzejszczak@gmail.com>
Co-authored-by: Tim van Baarsen <tim@jtim.nl>
Co-authored-by: 如梦技术 <596392912@qq.com>
Co-authored-by: Andrew Fitzgerald <andrewcfitzgerald@gmail.com>
Co-authored-by: Spencer Gibb <sgibb@pivotal.io>
Co-authored-by: shollander <shollander1@gmail.com>
Co-authored-by: Sébastien Deleuze <sdeleuze@users.noreply.github.com>
Co-authored-by: jialindai <53717919+jialindai@users.noreply.github.com>
Co-authored-by: Ryan Baxter <rbaxter@vmware.com>
Co-authored-by: Dave Syer <dsyer@vmware.com>
Co-authored-by: Dave Syer <dsyer@pivotal.io>
Co-authored-by: Jay Bryant <jbryant@pivotal.io>
Co-authored-by: Mushtaq Ahmed <ahm.mushtaq@gmail.com>
Co-authored-by: Ralph Goers <rgoers@apache.org>
Co-authored-by: alchemy24 <charu.covindane@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

9 participants