Skip to content

ReactorHttpResources should clear HttpResources in global mode [SPR-17199] #21733

@spring-projects-issues

Description

@spring-projects-issues

Brian Clozel opened SPR-17199 and commented

When configured in global mode, ReactorResourceFactory creates ConnectionProvider and LoopResources instances, then set those into Reactor HttpResources.

When the ReactorResourceFactory bean is being destroyed, those resources are being cleaned with their respective destroy method, without touching the global HttpResources itself.

When running multiple contexts in a row within the same JVM, here is what happens:

  1. Global resources are created by ReactorResourceFactory and set on HttpResources
  2. the application context is detroyed, ReactorResourceFactory cleans those resources
  3. Given the nature of HttpResources, it is still holding a reference to those resources, even though they've been disposed
  4. Another test runs and is just using a reactor netty server or client, not using a ReactorResourceFactory bean; it checks that HttpResources holds an instance already and is trying to use it
  5. Netty fails while submitting a task as those resources are disposed already

Reactor Netty just checks the presence of an HttpResources instance but does not test that the contained resources are valid (or were disposed from a 3rd party). In global mode, ReactorResourceFactory should call HttpResources.disposeLoopsAndConnections() directly.


Affects: 5.1 RC2

Issue Links:

Referenced from: commits spring-projects/spring-boot@2af8a96

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)type: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions