Skip to content

Revisit how WebClient disposes connection [SPR-15993] #20542

@spring-projects-issues

Description

@spring-projects-issues

Rossen Stoyanchev opened SPR-15993 and commented

#20474 introduced a close method on ClientResponse and applied it automatically when body reading methods are used. However while investigating #20523 we realized the underlying dispose() on the Reactor HttpClientResponse is not meant to be called always but rather only as a means of cancelling or declaring that you won't read the body. Using dispose actually closes the connection and counteracts the benefits of using a connection pool.

We should remove the automatic calls to close (the .doAfterTerminate(response::close) when reading the body and probably also perhaps revisit the close() method behavior and name.


Affects: 5.0 RC4

Issue Links:

Referenced from: commits 10139d4

1 votes, 2 watchers

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions