Skip to content

Commit 234b471

Browse files
committed
Use default bounded elastic scheduler
Instead of using a new bounded elastic scheduler per DefaultPartHttpMessageReader instance, which creates daemon threads that are not shut down, we now use the shared bounded elastic scheduler. Closes gh-26347
1 parent ce1ae2f commit 234b471

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

spring-web/src/main/java/org/springframework/http/codec/multipart/DefaultPartHttpMessageReader.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,7 @@ public class DefaultPartHttpMessageReader extends LoggingCodecSupport implements
7474

7575
private boolean streaming;
7676

77-
private Scheduler blockingOperationScheduler = Schedulers.newBoundedElastic(Schedulers.DEFAULT_BOUNDED_ELASTIC_SIZE,
78-
Schedulers.DEFAULT_BOUNDED_ELASTIC_QUEUESIZE, IDENTIFIER, 60, true);
77+
private Scheduler blockingOperationScheduler = Schedulers.boundedElastic();
7978

8079
private Mono<Path> fileStorageDirectory = Mono.defer(this::defaultFileStorageDirectory).cache();
8180

@@ -153,8 +152,9 @@ public void setFileStorageDirectory(Path fileStorageDirectory) throws IOExceptio
153152

154153
/**
155154
* Sets the Reactor {@link Scheduler} to be used for creating files and
156-
* directories, and writing to files. By default, a bounded scheduler is
157-
* created with default properties.
155+
* directories, and writing to files. By default,
156+
* {@link Schedulers#boundedElastic()} is used, but this property allows for
157+
* changing it to an externally managed scheduler.
158158
* <p>Note that this property is ignored when
159159
* {@linkplain #setStreaming(boolean) streaming} is enabled, or when
160160
* {@link #setMaxInMemorySize(int) maxInMemorySize} is set to -1.

0 commit comments

Comments
 (0)