-
Notifications
You must be signed in to change notification settings - Fork 38.9k
Closed
Labels
in: webIssues in web modules (web, webmvc, webflux, websocket)Issues in web modules (web, webmvc, webflux, websocket)status: backportedAn issue that has been backported to maintenance branchesAn issue that has been backported to maintenance branchestype: bugA general bugA general bug
Milestone
Description
in #35953, one of the cases described shows that using the WebTestClient the following way leaks data buffers:
var body = client.get().uri("download")
.exchange()
.expectStatus().isOk()
.returnResult()
.getResponseBodyContent();Here, the test performs expectations on the response status and headers, but not on the response body. The WiretapConnector already supports this case by subscribing to the Flux response body in those cases and accumulates the entire content as a single byte[]. In this case, the DataBuffer instances are not decoded by any Decoder and are not released. This results in a memory leak.
We should ensure that the automatic subscription in WiretapConnector also releases the buffers automatically as the DSL does not allow at that point to go back to performing body expectations.
Metadata
Metadata
Assignees
Labels
in: webIssues in web modules (web, webmvc, webflux, websocket)Issues in web modules (web, webmvc, webflux, websocket)status: backportedAn issue that has been backported to maintenance branchesAn issue that has been backported to maintenance branchestype: bugA general bugA general bug