Commit a21bfc2
committed
Delay ServletContext destruction until Undertow is destroyed
Previously, all destruction was done in the stop method including
closing any Closeables registered with the server. One of these
Closeables managed the lifecycle of the DeploymentManager for the
servlet deployment. Closing it made the servlet context unusable
in `@PreDestroy` methods and upon restart.
This commit moves the closing of the registered Closeables into
destroy(). This allows `@PreDestory` methods to use the
ServletContext. It also allows the server to be stopped and then
restarted without making the ServletContext unusable as it's left
running while the server itself is stopped and not accepting
requests.
Fixes gh-471411 parent 8249929 commit a21bfc2
File tree
2 files changed
+13
-15
lines changed- spring-boot-project/spring-boot/src
- main/java/org/springframework/boot/web/embedded/undertow
- test/java/org/springframework/boot/web/embedded/undertow
2 files changed
+13
-15
lines changedLines changed: 13 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
279 | 279 | | |
280 | 280 | | |
281 | 281 | | |
282 | | - | |
283 | | - | |
284 | | - | |
285 | 282 | | |
286 | 283 | | |
287 | 284 | | |
288 | 285 | | |
289 | 286 | | |
290 | 287 | | |
291 | 288 | | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
292 | 302 | | |
293 | 303 | | |
294 | 304 | | |
| |||
Lines changed: 0 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
255 | 255 | | |
256 | 256 | | |
257 | 257 | | |
258 | | - | |
259 | | - | |
260 | | - | |
261 | | - | |
262 | | - | |
263 | | - | |
264 | | - | |
265 | | - | |
266 | | - | |
267 | | - | |
268 | | - | |
269 | | - | |
270 | 258 | | |
271 | 259 | | |
272 | 260 | | |
| |||
0 commit comments