There is an issue when downloading a large file (which take some minutes to complete).
The endpoint returns 200, but after around 90 seconds waiting the download the connection is prematurely closed.
DEBUG 6 --- [ctor-http-nio-5] r.n.r.DefaultPooledConnectionProvider : [ecd64cf4-1, L:/* ! R:*] onStateChange(GET{uri=*, connection=PooledConnection{channel=[id: 0xecd64cf4, L:/*! R:*]}}, [response_incomplete])
ERROR 6 --- [ctor-http-nio-5] o.s.w.s.adapter.HttpWebHandlerAdapter : [de66232f-2] Error [reactor.netty.http.client.PrematureCloseException: Connection prematurely closed DURING response] for HTTP GET "*", but ServerHttpResponse already committed (200 OK)
TRACE 6 --- [ctor-http-nio-5] o.s.h.s.r.ReactorHttpHandlerAdapter : [de66232f-1, L:/*:3000 - R:/*:32383] Failed to complete: Connection prematurely closed DURING response
ERROR 6 --- [ctor-http-nio-5] r.n.http.server.HttpServerOperations : [de66232f-1, L:/*:3000 - R:/*:32383] Error finishing response. Closing connection
reactor.netty.http.client.PrematureCloseException: Connection prematurely closed DURING response
Suppressed: reactor.core.publisher.FluxOnAssembly$OnAssemblyException:
Error has been observed at the following site(s):
...
[ExceptionHandlingWebHandler]
reactor-netty-http: 1.0.39
spring-boot: 2.7.18
Java 11 (Also happens with Java 17)
I tried to set a higher timeout for this connection.
Tried to upgrade Spring Boot and Java.
Nothing worked.
New contributor
Guilherme Debom is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.