-
Notifications
You must be signed in to change notification settings - Fork 38.7k
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
The original report can in reactor/reactor-netty#1546. The scenario is an SSE endpoint with a reactive repository (MongoDB) but the use of the repository is not related or at least a leak can be demonstrated without it.
Using a controller like this:
@GetMapping(path = "/cars", produces = MediaType.TEXT_EVENT_STREAM_VALUE)
public Flux<Car> getCar() {
return Flux.interval(Duration.ofMillis(50))
.map(aLong -> new Car(aLong, gen.location()))
.onBackpressureDrop();
}
and a script like this:
for i in {1..100}; do ../../../tmp/wrk/wrk -t2 -c 100 -d 2s --latency http://localhost:8080/cars; done
I get a leak record that points to the `ServerSentEventHttpMessageWriter:
Recent access records:
Created at:
io.netty.buffer.AbstractByteBufAllocator.compositeDirectBuffer(AbstractByteBufAllocator.java:223)
io.netty.buffer.AbstractByteBufAllocator.compositeBuffer(AbstractByteBufAllocator.java:201)
org.springframework.core.io.buffer.NettyDataBufferFactory.join(NettyDataBufferFactory.java:108)
org.springframework.http.codec.ServerSentEventHttpMessageWriter.encodeEvent(ServerSentEventHttpMessageWriter.java:176)
org.springframework.http.codec.ServerSentEventHttpMessageWriter.lambda$encode$0(ServerSentEventHttpMessageWriter.java:160)
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