Skip to content

Conversation

robotmrv
Copy link
Contributor

@robotmrv robotmrv commented Feb 7, 2020

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

original issue gh-683
related to gh-629

- 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
healthyInstances.clear();
healthyInstances.addAll(verifiedInstances);
});
healthCheckDisposable = delegate.get().doOnNext(delegateInstances -> {
Copy link
Contributor Author

@robotmrv robotmrv Feb 7, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not see contract about ServiceInstanceListSupplier#get() Flux
Is it finite or could potentially be infinite?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it is finite (and assume that it has only one emit) what is the reason to return Flux instead of Mono from ServiceInstanceListSupplier#get?
If there is such contract maybe it is a good idea to document it, because it is not clear from current returning type

List<Mono<ServiceInstance>> checks = new ArrayList<>();
for (ServiceInstance instance : instances) {
Mono<ServiceInstance> alive = isAlive(instance)
.onErrorResume(throwable -> Mono.empty())
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should some logs be added here?
if so debug or warn?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, debug is my first instinct.

.exchange()
.map(clientResponse -> HttpStatus.OK.equals(clientResponse.statusCode()));
.flatMap(clientResponse -> clientResponse.releaseBody()
.thenReturn(HttpStatus.OK.equals(clientResponse.statusCode()))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should non standard codes be taken into account?
if so - it is better to use ClientResponse.rawStatusCode()

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure

- handle non-standard statuses
- instancesFlux and verifiedInstancesFlux work in parallel
List<ServiceInstance> result = new CopyOnWriteArrayList<>();
return Flux.merge(checks).map(alive -> {
result.add(alive);
return result;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as far as List is mutated should it be emitted on any update or only on first?
this could be rewritten to

List<ServiceInstance> result = new CopyOnWriteArrayList<>();
AtomicBoolean first = new AtomicBoolean(false);
return Flux.merge(checks).<List<ServiceInstance>>handle((alive, sink) -> {
	result.add(alive);
	if (first.compareAndSet(false, true)) {
		sink.next(result);
	}
})
.defaultIfEmpty(result);

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just Flux.merge(checks).collectList().defaultIfEmpty(emptyList())?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this question was addressed to my intermediate implementation which mutated healthyInstances field.
I was trying to preserve initial behavior.
.collectList() will wait until all health checks are completed, in initial implementation List was emitted on the first healthy instance presence. As far as I understand it was made due to the fact that all health checks could take a long time (in current implementation it is this.healthCheck.getInterval() but in initial it could be infinity) but it should return healthy instances as soon as possible.

*/
public class HealthCheckServiceInstanceListSupplier
implements ServiceInstanceListSupplier {
implements ServiceInstanceListSupplier, DisposableBean {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've tried to make minimal changes to the current logic but
I've found testing of ping functionality a little bit inconvenient
HealthCheckServiceInstanceListSupplier starts ping implicitly and eventually I test just another stream which uses common state...
IMO It signals that this functionality must be either moved to a new class or just spitted into different methods.
So I would like to make HealthCheckServiceInstanceListSupplier an InitializingBean , and move start of pings out of constructor
and
make this

Flux<List<ServiceInstance>> instancesFlux = this.delegate.get().doOnNext(delegateInstances -> {
	this.instances = Collections.unmodifiableList(new ArrayList<>(delegateInstances));
});

and

Flux<List<ServiceInstance>> verifiedInstancesFlux = healthCheckFlux()
		.doOnNext((verifiedInstances -> {
			this.healthyInstances = verifiedInstances;
		}));

two distinct methods which are invoked from afterPropertiesSet()
does this make sense @spencergibb @OlgaMaciaszek

Comment on lines 60 to 64
.synchronizedList(new ArrayList<>());
private volatile List<ServiceInstance> instances = Collections.emptyList();

private List<ServiceInstance> healthyInstances = Collections
.synchronizedList(new ArrayList<>());
private volatile List<ServiceInstance> healthyInstances = Collections.emptyList();

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could remove state with such changes

private Flux<List<ServiceInstance>> aliveInstancesReplay;
...
//in the constructor 
this.aliveInstancesReplay = this.delegate.get()
				.switchMap(serviceInstances -> {
					return healthCheckFlux(serviceInstances).map(alive -> alive.isEmpty() ? serviceInstances : alive);
				})
				.replay(1)
				.autoConnect()
				.onBackpressureLatest();
...
protected Flux<List<ServiceInstance>> healthCheckFlux(List<ServiceInstance> instances) {
...//the same logic but uses `instances` method arg instead of class field
}
...
public void afterPropertiesSet() {
    this.healthCheckDisposable = aliveInstancesReplay.subscribe();
}

//and `get()` become just 
@Override
public Flux<List<ServiceInstance>> get() {
	return aliveInstancesReplay;
}

less state and it is easier to test

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

downside - requires protected method signature change, but it was introduced recently so it is not a problem

 - use Flux.replay() instead of caching in the field
 - make lazy delegate call
@robotmrv
Copy link
Contributor Author

@spencergibb @OlgaMaciaszek
Changes are ready for review.
Initial issue #629 is closed
Should it be reopened or should I create new issue?

@spencergibb
Copy link
Member

@robotmrv this PR is fine, no need to open anything else.

@robotmrv
Copy link
Contributor Author

robotmrv commented Mar 3, 2020

@spencergibb @OlgaMaciaszek
kindly reminder that this PR is ready for review

@spencergibb spencergibb changed the title fixes issues from gh-683 Fixes issues in HealthCheckServiceInstanceListSupplier Mar 3, 2020
@spencergibb spencergibb added this to the 2.2.2.RELEASE milestone Mar 3, 2020
@spencergibb spencergibb merged commit 6db6a81 into spring-cloud:2.2.x Mar 3, 2020
}
return Mono.empty();
}))
.handle((isHealthy, sink) -> {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can be replaced with .filter(isHealthy -> isHealthy)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bsideup , not really.
it can be replaced by

.filter(isHealthy -> isHealthy)
.map(it -> instance)

but is filter + map more efficient then handle? I thought handle is just for such cases

Copy link
Collaborator

@OlgaMaciaszek OlgaMaciaszek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@robotmrv Reviewing after merge as requested. Looks definitely good to me :) . Have learnt some better ways of doing certain things with Reactor in this PR. Also, like the way you've used StepVerifier in test. We should probably use it more frequently in Cloud projects.

Not sure why you've added the setup method in the test, though - AFAIK, works same with field instantiation. Also, why are you adding a local variable assignment in afterPropertiesSet() and in destroy() methods? I assume it's for performance improvement?

The logic looks good to me. Will, however, change some cosmetics things, such as unnecessary use of this. and abbreviatory variable names to adjust to Spring Cloud team conventions.

@robotmrv
Copy link
Contributor Author

@OlgaMaciaszek

Not sure why you've added the setup method in the test, though - AFAIK, works same with field instantiation.

it creates new instance for each test so previous test will not influence next one, also it is just to avoid instantiation in each test method.

Also, why are you adding a local variable assignment in afterPropertiesSet() and in destroy() methods? I assume it's for performance improvement?

It is not for performance reasons. I just dispose that was checked

Will, however, change some cosmetics things, such as unnecessary use of this.

No problem it is redundant but just looks more clear to me, especially when I look at code on github. Recently spring-security team asked me to add this. in another PR, I thought you have similar conventions.

roboslyq added a commit to roboslyq/spring-cloud-commons that referenced this pull request 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 <[email protected]>

* 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 <[email protected]>

* 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 <[email protected]>

* 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 <[email protected]>
Co-authored-by: buildmaster <[email protected]>
Co-authored-by: Spencer Gibb <[email protected]>
Co-authored-by: Olga Maciaszek-Sharma <[email protected]>
Co-authored-by: shenjianeng <[email protected]>
Co-authored-by: Spencer Gibb <[email protected]>
Co-authored-by: robotmrv <[email protected]>
Co-authored-by: JinSoo Han <[email protected]>
Co-authored-by: jinsoohan <[email protected]>
Co-authored-by: Timothy <[email protected]>
Co-authored-by: Nikita Konev <[email protected]>
Co-authored-by: Marcin Grzejszczak <[email protected]>
Co-authored-by: Tim van Baarsen <[email protected]>
Co-authored-by: 如梦技术 <[email protected]>
Co-authored-by: Andrew Fitzgerald <[email protected]>
Co-authored-by: Spencer Gibb <[email protected]>
Co-authored-by: shollander <[email protected]>
Co-authored-by: Sébastien Deleuze <[email protected]>
Co-authored-by: jialindai <[email protected]>
Co-authored-by: Ryan Baxter <[email protected]>
Co-authored-by: Dave Syer <[email protected]>
Co-authored-by: Dave Syer <[email protected]>
Co-authored-by: Jay Bryant <[email protected]>
Co-authored-by: Mushtaq Ahmed <[email protected]>
Co-authored-by: Ralph Goers <[email protected]>
Co-authored-by: alchemy24 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants