-
Notifications
You must be signed in to change notification settings - Fork 38.8k
Closed
Labels
in: webIssues in web modules (web, webmvc, webflux, websocket)Issues in web modules (web, webmvc, webflux, websocket)type: bugA general bugA general bug
Milestone
Description
Version
spring-boot version 3.3.1
spring-webflux 6.1.10
Description
In one of our applications, we are facing OutOfMemory error.
We think, that it is connected with Webflux and the upload files using HTTP Multipart requests.
We managed to create a small project with the test, that is able to reproduce issue:
LEAK: ByteBuf.release() was not called before it's garbage-collected.
The project can be found here: https://github.com/bugs84/webflux-leak-02
Basically, there is a controller that accepts multipart and saves it into the files.
@PostMapping("/upload-files10")
fun uploadFileWithoutEntity(@RequestPart("files", required = false) filePartFlux: Flux<Part>): Mono<*> {
return filePartFlux.collectList().flatMap { fileList: List<Part> ->
Flux.fromIterable(fileList).flatMapSequential { file: Part ->
val destination = Paths.get("generated_${fileNumber++}.file")
DataBufferUtils.write(file.content(), destination).then(Mono.just("ok"))
}.then(Mono.just("OK"))
}
}
If we run the test it should generate the mentioned LEAK:
issue.
koscejev, Domel303 and b0m123
Metadata
Metadata
Assignees
Labels
in: webIssues in web modules (web, webmvc, webflux, websocket)Issues in web modules (web, webmvc, webflux, websocket)type: bugA general bugA general bug