Skip to content

ClientHttpRequestFactorySupplier potentially instantiates a DisposableBean out of application context #31075

@jstermask

Description

@jstermask

ClientHttpRequestFactorySupplier and RestTemplateBuilder use to instantiate a ClientHttpRequestFactory.

However, i noticed that https://github.com/spring-projects/spring-framework/blob/master/spring-web/src/main/java/org/springframework/http/client/HttpComponentsClientHttpRequestFactory.java is a ClientHttpRequestFactory but is also a DisposableBean that is supposed to close the underlying httpClient.

I may be wrong but this means that if we use ClientHttpRequestFactorySupplier or RestTemplateBuilder in conjunction with HttpComponentsClientHttpRequestFactory class, we may have a resource leak there.

Using Spring Boot 2.2.9 RELEASE, Spring Web 5.2.8 RELEASE

Metadata

Metadata

Assignees

Labels

for: external-projectFor an external project and not something we can fixstatus: invalidAn issue that we don't feel is valid

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions