Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
9e7d9225
Commit
9e7d9225
authored
Apr 02, 2019
by
Andy Wilkinson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow processor cache to be configured to be unlimited
Closes gh-16415
parent
ea80ca2f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
3 deletions
+14
-3
ServerProperties.java
...ingframework/boot/autoconfigure/web/ServerProperties.java
+2
-1
TomcatWebServerFactoryCustomizer.java
...figure/web/embedded/TomcatWebServerFactoryCustomizer.java
+1
-1
TomcatWebServerFactoryCustomizerTests.java
...e/web/embedded/TomcatWebServerFactoryCustomizerTests.java
+11
-1
No files found.
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java
View file @
9e7d9225
...
...
@@ -368,7 +368,8 @@ public class ServerProperties {
/**
* Maximum number of idle processors that will be retained in the cache and reused
* with a subsequent request.
* with a subsequent request. When set to -1 the cache will be unlimited with a
* theoretical maximum size equal to the maximum number of connections.
*/
private
int
processorCache
=
200
;
...
...
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/embedded/TomcatWebServerFactoryCustomizer.java
View file @
9e7d9225
...
...
@@ -110,7 +110,7 @@ public class TomcatWebServerFactoryCustomizer implements
.
to
((
maxConnections
)
->
customizeMaxConnections
(
factory
,
maxConnections
));
propertyMapper
.
from
(
tomcatProperties:
:
getAcceptCount
).
when
(
this
::
isPositive
)
.
to
((
acceptCount
)
->
customizeAcceptCount
(
factory
,
acceptCount
));
propertyMapper
.
from
(
tomcatProperties:
:
getProcessorCache
)
.
when
(
this
::
isPositive
)
propertyMapper
.
from
(
tomcatProperties:
:
getProcessorCache
)
.
to
((
processorCache
)
->
customizeProcessorCache
(
factory
,
processorCache
));
customizeStaticResources
(
factory
);
customizeErrorReportValve
(
properties
.
getError
(),
factory
);
...
...
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/embedded/TomcatWebServerFactoryCustomizerTests.java
View file @
9e7d9225
...
...
@@ -89,7 +89,17 @@ public class TomcatWebServerFactoryCustomizerTests {
@Test
public
void
customProcessorCache
()
{
bind
(
"server.tomcat.processor-cache=100"
);
assertThat
(
this
.
serverProperties
.
getTomcat
().
getProcessorCache
()).
isEqualTo
(
100
);
customizeAndRunServer
((
server
)
->
assertThat
(((
AbstractProtocol
<?>)
server
.
getTomcat
().
getConnector
().
getProtocolHandler
()).
getProcessorCache
())
.
isEqualTo
(
100
));
}
@Test
public
void
unlimitedProcessorCache
()
{
bind
(
"server.tomcat.processor-cache=-1"
);
customizeAndRunServer
((
server
)
->
assertThat
(((
AbstractProtocol
<?>)
server
.
getTomcat
().
getConnector
().
getProtocolHandler
()).
getProcessorCache
())
.
isEqualTo
(-
1
));
}
@Test
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment