diff --git a/core/src/main/java/org/springframework/security/authentication/ReactiveAuthenticationManagerAdapter.java b/core/src/main/java/org/springframework/security/authentication/ReactiveAuthenticationManagerAdapter.java index 21a45adac4..087a169b94 100644 --- a/core/src/main/java/org/springframework/security/authentication/ReactiveAuthenticationManagerAdapter.java +++ b/core/src/main/java/org/springframework/security/authentication/ReactiveAuthenticationManagerAdapter.java @@ -34,7 +34,7 @@ import reactor.core.scheduler.Schedulers; public class ReactiveAuthenticationManagerAdapter implements ReactiveAuthenticationManager { private final AuthenticationManager authenticationManager; - private Scheduler scheduler = Schedulers.elastic(); + private Scheduler scheduler = Schedulers.boundedElastic(); public ReactiveAuthenticationManagerAdapter(AuthenticationManager authenticationManager) { Assert.notNull(authenticationManager, "authenticationManager cannot be null"); diff --git a/gradle/dependency-management.gradle b/gradle/dependency-management.gradle index 95fca71ef9..1056d65fe5 100644 --- a/gradle/dependency-management.gradle +++ b/gradle/dependency-management.gradle @@ -1,5 +1,5 @@ if (!project.hasProperty('reactorVersion')) { - ext.reactorVersion = 'Dysprosium-RC1' + ext.reactorVersion = 'Dysprosium-BUILD-SNAPSHOT' } if (!project.hasProperty('springVersion')) { diff --git a/oauth2/oauth2-client/src/main/java/org/springframework/security/oauth2/client/web/reactive/function/client/ServletOAuth2AuthorizedClientExchangeFilterFunction.java b/oauth2/oauth2-client/src/main/java/org/springframework/security/oauth2/client/web/reactive/function/client/ServletOAuth2AuthorizedClientExchangeFilterFunction.java index 53f9a2e6bd..72b372300f 100644 --- a/oauth2/oauth2-client/src/main/java/org/springframework/security/oauth2/client/web/reactive/function/client/ServletOAuth2AuthorizedClientExchangeFilterFunction.java +++ b/oauth2/oauth2-client/src/main/java/org/springframework/security/oauth2/client/web/reactive/function/client/ServletOAuth2AuthorizedClientExchangeFilterFunction.java @@ -463,9 +463,10 @@ public final class ServletOAuth2AuthorizedClientExchangeFilterFunction }); OAuth2AuthorizeRequest authorizeRequest = builder.build(); - // NOTE: 'authorizedClientManager.authorize()' needs to be executed on a dedicated thread via subscribeOn(Schedulers.elastic()) + // NOTE: 'authorizedClientManager.authorize()' needs to be executed on a dedicated thread via subscribeOn(Schedulers.boundedElastic()) + // NOTE: 'authorizedClientManager.authorize()' needs to be executed on a dedicated thread via subscribeOn(Schedulers.boundedElastic()) // since it performs a blocking I/O operation using RestTemplate internally - return Mono.fromSupplier(() -> this.authorizedClientManager.authorize(authorizeRequest)).subscribeOn(Schedulers.elastic()); + return Mono.fromSupplier(() -> this.authorizedClientManager.authorize(authorizeRequest)).subscribeOn(Schedulers.boundedElastic()); } private Mono authorizedClient(OAuth2AuthorizedClient authorizedClient, ClientRequest request) { @@ -491,9 +492,9 @@ public final class ServletOAuth2AuthorizedClientExchangeFilterFunction }); OAuth2AuthorizeRequest reauthorizeRequest = builder.build(); - // NOTE: 'authorizedClientManager.authorize()' needs to be executed on a dedicated thread via subscribeOn(Schedulers.elastic()) + // NOTE: 'authorizedClientManager.authorize()' needs to be executed on a dedicated thread via subscribeOn(Schedulers.boundedElastic()) // since it performs a blocking I/O operation using RestTemplate internally - return Mono.fromSupplier(() -> this.authorizedClientManager.authorize(reauthorizeRequest)).subscribeOn(Schedulers.elastic()); + return Mono.fromSupplier(() -> this.authorizedClientManager.authorize(reauthorizeRequest)).subscribeOn(Schedulers.boundedElastic()); } private ClientRequest bearer(ClientRequest request, OAuth2AuthorizedClient authorizedClient) {