reactor-netty: Getting a lot of PrematureCloseException : Connection prematurely closed BEFORE response

Expected Behavior

I should always get the proper response

Actual Behavior

i am getting 500 exception intermittently i am call a third party api through webclient.

2021-05-21 15:04:34.425 DEBUG [Broker-Api,5223daffae63051988e2ac6c889e6865,e24e1e6f97e470d8] 46 --- [or-http-epoll-1] r.n.http.server.HttpServerOperations     : [id: 0x56ea07ae, L:/127.0.0.1:8085 - R:/127.0.0.1:34940] Decreasing pending responses, now 0
2021-05-21 15:04:34.425 DEBUG [Broker-Api,5223daffae63051988e2ac6c889e6865,e24e1e6f97e470d8] 46 --- [or-http-epoll-1] r.n.http.server.HttpServerOperations     : [id: 0x56ea07ae, L:/127.0.0.1:8085 - R:/127.0.0.1:34940] Last HTTP packet was sent, terminating the channel
2021-05-21 15:04:34.425 DEBUG [Broker-Api,5223daffae63051988e2ac6c889e6865,e24e1e6f97e470d8] 46 --- [or-http-epoll-1] r.n.http.server.HttpServerOperations     : [id: 0x56ea07ae, L:/127.0.0.1:8085 - R:/127.0.0.1:34940] Last HTTP response frame
2021-05-21 15:04:34.426 DEBUG [Broker-Api,,] 46 --- [or-http-epoll-1] r.n.r.DefaultPooledConnectionProvider    : [id: 0xb061a768, L:/10.0.2.166:58068 - R:ciapi.cityindex.com/104.18.27.190:443] onStateChange(GET{uri=/TradingAPI/useraccount/ClientAndTradingAccount, connection=PooledConnection{channel=[id: 0xb061a768, L:/10.0.2.166:58068 - R:ciapi.cityindex.com/104.18.27.190:443]}}, [response_completed])
2021-05-21 15:04:34.426 DEBUG [Broker-Api,,] 46 --- [or-http-epoll-1] r.n.r.DefaultPooledConnectionProvider    : [id: 0xb061a768, L:/10.0.2.166:58068 - R:ciapi.cityindex.com/104.18.27.190:443] onStateChange(GET{uri=/TradingAPI/useraccount/ClientAndTradingAccount, connection=PooledConnection{channel=[id: 0xb061a768, L:/10.0.2.166:58068 - R:ciapi.cityindex.com/104.18.27.190:443]}}, [disconnecting])
2021-05-21 15:04:34.426 DEBUG [Broker-Api,,] 46 --- [or-http-epoll-1] r.n.r.DefaultPooledConnectionProvider    : [id: 0xb061a768, L:/10.0.2.166:58068 - R:ciapi.cityindex.com/104.18.27.190:443] Releasing channel
2021-05-21 15:04:34.426 DEBUG [Broker-Api,,] 46 --- [or-http-epoll-1] r.n.r.DefaultPooledConnectionProvider    : [id: 0xb061a768, L:/10.0.2.166:58068 - R:ciapi.cityindex.com/104.18.27.190:443] Channel cleaned, now 0 active connections and 1 inactive connections
2021-05-21 15:04:34.426 DEBUG [Broker-Api,,] 46 --- [or-http-epoll-1] reactor.netty.http.client.HttpClient     : [id: 0xb061a768, L:/10.0.2.166:58068 - R:ciapi.cityindex.com/104.18.27.190:443] READ COMPLETE
2021-05-21 15:04:34.750 DEBUG [Broker-Api,,] 46 --- [or-http-epoll-1] r.n.http.server.HttpServerOperations     : [id: 0x56ea07ae, L:/127.0.0.1:8085 - R:/127.0.0.1:34940] Increasing pending responses, now 1
2021-05-21 15:04:34.750 DEBUG [Broker-Api,,] 46 --- [or-http-epoll-1] reactor.netty.http.server.HttpServer     : [id: 0x56ea07ae, L:/127.0.0.1:8085 - R:/127.0.0.1:34940] Handler is being applied: org.springframework.http.server.reactive.ReactorHttpHandlerAdapter@519906b
2021-05-21 15:04:34.752 DEBUG [Broker-Api,,] 46 --- [or-http-epoll-1] r.n.http.server.HttpServerOperations     : [id: 0x56ea07ae, L:/127.0.0.1:8085 - R:/127.0.0.1:34940] Last HTTP response frame
2021-05-21 15:04:34.752 DEBUG [Broker-Api,,] 46 --- [or-http-epoll-1] r.n.http.server.HttpServerOperations     : [id: 0x56ea07ae, L:/127.0.0.1:8085 - R:/127.0.0.1:34940] No sendHeaders() called before complete, sending zero-length header
2021-05-21 15:04:34.753 DEBUG [Broker-Api,,] 46 --- [or-http-epoll-1] r.n.http.server.HttpServerOperations     : [id: 0x56ea07ae, L:/127.0.0.1:8085 - R:/127.0.0.1:34940] Decreasing pending responses, now 0
2021-05-21 15:04:34.753 DEBUG [Broker-Api,,] 46 --- [or-http-epoll-1] r.n.http.server.HttpServerOperations     : [id: 0x56ea07ae, L:/127.0.0.1:8085 - R:/127.0.0.1:34940] Last HTTP packet was sent, terminating the channel
2021-05-21 15:04:34.753 DEBUG [Broker-Api,,] 46 --- [or-http-epoll-1] r.n.channel.ChannelOperationsHandler     : [id: 0x56ea07ae, L:/127.0.0.1:8085 - R:/127.0.0.1:34940] No ChannelOperation attached. Dropping: EmptyLastHttpContent
2021-05-21 15:04:35.289 DEBUG [Broker-Api,,] 46 --- [or-http-epoll-1] r.n.http.server.HttpServerOperations     : [id: 0x56ea07ae, L:/127.0.0.1:8085 - R:/127.0.0.1:34940] Increasing pending responses, now 1
2021-05-21 15:04:35.289 DEBUG [Broker-Api,,] 46 --- [or-http-epoll-1] reactor.netty.http.server.HttpServer     : [id: 0x56ea07ae, L:/127.0.0.1:8085 - R:/127.0.0.1:34940] Handler is being applied: org.springframework.http.server.reactive.ReactorHttpHandlerAdapter@519906b
2021-05-21 15:04:35.292 DEBUG [Broker-Api,,] 46 --- [or-http-epoll-4] r.n.r.DefaultPooledConnectionProvider    : [id: 0xb332167f, L:/10.0.2.166:50976 - R:ciapi.cityindex.com/104.18.26.190:443] Channel acquired, now 1 active connections and 4 inactive connections
2021-05-21 15:04:35.292 DEBUG [Broker-Api,,] 46 --- [or-http-epoll-4] r.netty.http.client.HttpClientConnect    : [id: 0xb332167f, L:/10.0.2.166:50976 - R:ciapi.cityindex.com/104.18.26.190:443] Handler is being applied: {uri=https://ciapi.cityindex.com/TradingAPI/market/searchwithtags?tagId=80&searchByMarketCode=true&searchByMarketName=true&spreadProductType=true&cfdProductType=true&binaryProductType=true&includeOptions=true&useMobileShortName=false, method=GET}
2021-05-21 15:04:35.292 DEBUG [Broker-Api,,] 46 --- [or-http-epoll-4] r.n.r.DefaultPooledConnectionProvider    : [id: 0xb332167f, L:/10.0.2.166:50976 - R:ciapi.cityindex.com/104.18.26.190:443] onStateChange(GET{uri=/TradingAPI/market/searchwithtags?tagId=80&searchByMarketCode=true&searchByMarketName=true&spreadProductType=true&cfdProductType=true&binaryProductType=true&includeOptions=true&useMobileShortName=false, connection=PooledConnection{channel=[id: 0xb332167f, L:/10.0.2.166:50976 - R:ciapi.cityindex.com/104.18.26.190:443]}}, [request_prepared])
2021-05-21 15:04:35.292 DEBUG [Broker-Api,7990fae3cfe8c31891d95b0077cbca76,7df3511a6d748e0c] 46 --- [or-http-epoll-4] r.n.r.DefaultPooledConnectionProvider    : [id: 0xb332167f, L:/10.0.2.166:50976 - R:ciapi.cityindex.com/104.18.26.190:443] onStateChange(GET{uri=/TradingAPI/market/searchwithtags?tagId=80&searchByMarketCode=true&searchByMarketName=true&spreadProductType=true&cfdProductType=true&binaryProductType=true&includeOptions=true&useMobileShortName=false, connection=PooledConnection{channel=[id: 0xb332167f, L:/10.0.2.166:50976 - R:ciapi.cityindex.com/104.18.26.190:443]}}, [request_sent])
2021-05-21 15:04:35.294 DEBUG [Broker-Api,,] 46 --- [or-http-epoll-4] r.n.r.DefaultPooledConnectionProvider    : [id: 0xb332167f, L:/10.0.2.166:50976 ! R:ciapi.cityindex.com/104.18.26.190:443] Channel closed, now 0 active connections and 4 inactive connections
2021-05-21 15:04:35.294 DEBUG [Broker-Api,,] 46 --- [or-http-epoll-4] r.n.r.DefaultPooledConnectionProvider    : [id: 0xb332167f, L:/10.0.2.166:50976 ! R:ciapi.cityindex.com/104.18.26.190:443] onStateChange(GET{uri=/TradingAPI/market/searchwithtags?tagId=80&searchByMarketCode=true&searchByMarketName=true&spreadProductType=true&cfdProductType=true&binaryProductType=true&includeOptions=true&useMobileShortName=false, connection=PooledConnection{channel=[id: 0xb332167f, L:/10.0.2.166:50976 ! R:ciapi.cityindex.com/104.18.26.190:443]}}, [response_incomplete])
2021-05-21 15:04:35.294  WARN [Broker-Api,,] 46 --- [or-http-epoll-4] r.netty.http.client.HttpClientConnect    : [id: 0xb332167f, L:/10.0.2.166:50976 ! R:ciapi.cityindex.com/104.18.26.190:443] The connection observed an error

reactor.netty.http.client.PrematureCloseException: Connection prematurely closed BEFORE response

2021-05-21 15:04:35.296 ERROR [Broker-Api,7990fae3cfe8c31891d95b0077cbca76,7df3511a6d748e0c] 46 --- [or-http-epoll-4] a.w.r.e.AbstractErrorWebExceptionHandler : [56ea07ae-30149]  500 Server Error for HTTP GET "/api/forex/market/searchwithtags?tagId=80"

org.springframework.web.reactive.function.client.WebClientRequestException: Connection prematurely closed BEFORE response; nested exception is reactor.netty.http.client.PrematureCloseException: Connection prematurely closed BEFORE response
	at org.springframework.web.reactive.function.client.ExchangeFunctions$DefaultExchangeFunction.lambda$wrapException$9(ExchangeFunctions.java:137) ~[spring-webflux-5.3.4.jar:5.3.4]
	Suppressed: reactor.core.publisher.FluxOnAssembly$OnAssemblyException:
Error has been observed at the following site(s):
	|_ checkpoint ⇢ Request to GET https://ciapi.cityindex.com/TradingAPI/market/searchwithtags?tagId=80&searchByMarketCode=true&searchByMarketName=true&spreadProductType=true&cfdProductType=true&binaryProductType=true&includeOptions=true&useMobileShortName=false [DefaultWebClient]
	|_ checkpoint ⇢ Handler com.innovect.trading.forex.controller.ForexMarketController#searchwithtags(String, String, Optional, Optional, Optional, Optional, Optional, Optional, Optional, Optional, Optional, Optional, Optional) [DispatcherHandler]
	|_ checkpoint ⇢ org.springframework.web.filter.reactive.ServerWebExchangeContextFilter [DefaultWebFilterChain]
	|_ checkpoint ⇢ org.springframework.security.web.server.authorization.AuthorizationWebFilter [DefaultWebFilterChain]
	|_ checkpoint ⇢ org.springframework.security.web.server.authorization.ExceptionTranslationWebFilter [DefaultWebFilterChain]
	|_ checkpoint ⇢ org.springframework.security.web.server.authentication.logout.LogoutWebFilter [DefaultWebFilterChain]
	|_ checkpoint ⇢ org.springframework.security.web.server.savedrequest.ServerRequestCacheWebFilter [DefaultWebFilterChain]
	|_ checkpoint ⇢ org.springframework.security.web.server.context.SecurityContextServerWebExchangeWebFilter [DefaultWebFilterChain]
	|_ checkpoint ⇢ org.springframework.security.web.server.context.ReactorContextWebFilter [DefaultWebFilterChain]
	|_ checkpoint ⇢ org.springframework.security.web.server.header.HttpHeaderWriterWebFilter [DefaultWebFilterChain]
	|_ checkpoint ⇢ org.springframework.security.config.web.server.ServerHttpSecurity$ServerWebExchangeReactorContextWebFilter [DefaultWebFilterChain]
	|_ checkpoint ⇢ org.springframework.security.web.server.WebFilterChainProxy [DefaultWebFilterChain]
	|_ checkpoint ⇢ org.springframework.cloud.sleuth.instrument.web.TraceWebFilter [DefaultWebFilterChain]
	|_ checkpoint ⇢ org.springframework.boot.actuate.metrics.web.reactive.server.MetricsWebFilter [DefaultWebFilterChain]
	|_ checkpoint ⇢ HTTP GET "/api/forex/market/searchwithtags?tagId=80" [ExceptionHandlingWebHandler]
Stack trace:
		at org.springframework.web.reactive.function.client.ExchangeFunctions$DefaultExchangeFunction.lambda$wrapException$9(ExchangeFunctions.java:137) ~[spring-webflux-5.3.4.jar:5.3.4]
		at reactor.core.publisher.MonoErrorSupplied.subscribe(MonoErrorSupplied.java:70) ~[reactor-core-3.4.3.jar:3.4.3]
		at reactor.core.publisher.Mono.subscribe(Mono.java:4046) ~[reactor-core-3.4.3.jar:3.4.3]
		at reactor.core.publisher.FluxOnErrorResume$ResumeSubscriber.onError(FluxOnErrorResume.java:103) ~[reactor-core-3.4.3.jar:3.4.3]
		at org.springframework.cloud.sleuth.instrument.reactor.ScopePassingSpanSubscriber.onError(ScopePassingSpanSubscriber.java:95) ~[spring-cloud-sleuth-instrumentation-3.0.1.jar:3.0.1]
		at reactor.core.publisher.FluxPeek$PeekSubscriber.onError(FluxPeek.java:221) ~[reactor-core-3.4.3.jar:3.4.3]
		at org.springframework.cloud.sleuth.instrument.reactor.ScopePassingSpanSubscriber.onError(ScopePassingSpanSubscriber.java:95) ~[spring-cloud-sleuth-instrumentation-3.0.1.jar:3.0.1]
		at reactor.core.publisher.FluxPeek$PeekSubscriber.onError(FluxPeek.java:221) ~[reactor-core-3.4.3.jar:3.4.3]
		at org.springframework.cloud.sleuth.instrument.reactor.ScopePassingSpanSubscriber.onError(ScopePassingSpanSubscriber.java:95) ~[spring-cloud-sleuth-instrumentation-3.0.1.jar:3.0.1]
		at reactor.core.publisher.FluxPeek$PeekSubscriber.onError(FluxPeek.java:221) ~[reactor-core-3.4.3.jar:3.4.3]
		at org.springframework.cloud.sleuth.instrument.reactor.ScopePassingSpanSubscriber.onError(ScopePassingSpanSubscriber.java:95) ~[spring-cloud-sleuth-instrumentation-3.0.1.jar:3.0.1]
		at reactor.core.publisher.MonoNext$NextSubscriber.onError(MonoNext.java:93) ~[reactor-core-3.4.3.jar:3.4.3]
		at org.springframework.cloud.sleuth.instrument.reactor.ScopePassingSpanSubscriber.onError(ScopePassingSpanSubscriber.java:95) ~[spring-cloud-sleuth-instrumentation-3.0.1.jar:3.0.1]
		at reactor.core.publisher.MonoFlatMapMany$FlatMapManyMain.onError(MonoFlatMapMany.java:204) ~[reactor-core-3.4.3.jar:3.4.3]
		at org.springframework.cloud.sleuth.instrument.reactor.ScopePassingSpanSubscriber.onError(ScopePassingSpanSubscriber.java:95) ~[spring-cloud-sleuth-instrumentation-3.0.1.jar:3.0.1]
		at reactor.core.publisher.SerializedSubscriber.onError(SerializedSubscriber.java:124) ~[reactor-core-3.4.3.jar:3.4.3]
		at reactor.core.publisher.FluxRetryWhen$RetryWhenMainSubscriber.whenError(FluxRetryWhen.java:224) ~[reactor-core-3.4.3.jar:3.4.3]
		at reactor.core.publisher.FluxRetryWhen$RetryWhenOtherSubscriber.onError(FluxRetryWhen.java:273) ~[reactor-core-3.4.3.jar:3.4.3]
		at org.springframework.cloud.sleuth.instrument.reactor.ScopePassingSpanSubscriber.onError(ScopePassingSpanSubscriber.java:95) ~[spring-cloud-sleuth-instrumentation-3.0.1.jar:3.0.1]
		at reactor.core.publisher.FluxConcatMap$ConcatMapImmediate.innerError(FluxConcatMap.java:308) ~[reactor-core-3.4.3.jar:3.4.3]
		at reactor.core.publisher.FluxConcatMap$ConcatMapInner.onError(FluxConcatMap.java:872) ~[reactor-core-3.4.3.jar:3.4.3]
		at reactor.core.publisher.Operators.error(Operators.java:197) ~[reactor-core-3.4.3.jar:3.4.3]
		at reactor.core.publisher.MonoError.subscribe(MonoError.java:52) ~[reactor-core-3.4.3.jar:3.4.3]
		at reactor.core.publisher.Mono.subscribe(Mono.java:4046) ~[reactor-core-3.4.3.jar:3.4.3]
		at reactor.core.publisher.FluxConcatMap$ConcatMapImmediate.drain(FluxConcatMap.java:448) ~[reactor-core-3.4.3.jar:3.4.3]
		at reactor.core.publisher.FluxConcatMap$ConcatMapImmediate.onNext(FluxConcatMap.java:250) ~[reactor-core-3.4.3.jar:3.4.3]
		at reactor.core.publisher.EmitterProcessor.drain(EmitterProcessor.java:491) ~[reactor-core-3.4.3.jar:3.4.3]
		at reactor.core.publisher.EmitterProcessor.tryEmitNext(EmitterProcessor.java:299) ~[reactor-core-3.4.3.jar:3.4.3]
		at reactor.core.publisher.SinkManySerialized.tryEmitNext(SinkManySerialized.java:97) ~[reactor-core-3.4.3.jar:3.4.3]
		at reactor.core.publisher.InternalManySink.emitNext(InternalManySink.java:27) ~[reactor-core-3.4.3.jar:3.4.3]
		at reactor.core.publisher.FluxRetryWhen$RetryWhenMainSubscriber.onError(FluxRetryWhen.java:189) ~[reactor-core-3.4.3.jar:3.4.3]
		at org.springframework.cloud.sleuth.instrument.reactor.ScopePassingSpanSubscriber.onError(ScopePassingSpanSubscriber.java:95) ~[spring-cloud-sleuth-instrumentation-3.0.1.jar:3.0.1]
		at reactor.core.publisher.MonoCreate$DefaultMonoSink.error(MonoCreate.java:189) ~[reactor-core-3.4.3.jar:3.4.3]
		at reactor.netty.http.client.HttpClientConnect$HttpObserver.onUncaughtException(HttpClientConnect.java:355) ~[reactor-netty-http-1.0.4.jar:1.0.4]
		at reactor.netty.ReactorNetty$CompositeConnectionObserver.onUncaughtException(ReactorNetty.java:631) ~[reactor-netty-core-1.0.4.jar:1.0.4]
		at reactor.netty.resources.DefaultPooledConnectionProvider$DisposableAcquire.onUncaughtException(DefaultPooledConnectionProvider.java:213) ~[reactor-netty-core-1.0.4.jar:1.0.4]
		at reactor.netty.resources.DefaultPooledConnectionProvider$PooledConnection.onUncaughtException(DefaultPooledConnectionProvider.java:476) ~[reactor-netty-core-1.0.4.jar:1.0.4]
		at reactor.netty.http.client.HttpClientOperations.onInboundClose(HttpClientOperations.java:289) ~[reactor-netty-http-1.0.4.jar:1.0.4]
		at reactor.netty.channel.ChannelOperationsHandler.channelInactive(ChannelOperationsHandler.java:74) ~[reactor-netty-core-1.0.4.jar:1.0.4]
		at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:262) ~[netty-transport-4.1.59.Final.jar:4.1.59.Final]
		at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:248) ~[netty-transport-4.1.59.Final.jar:4.1.59.Final]
		at io.netty.channel.AbstractChannelHandlerContext.fireChannelInactive(AbstractChannelHandlerContext.java:241) ~[netty-transport-4.1.59.Final.jar:4.1.59.Final]
		at io.netty.channel.ChannelInboundHandlerAdapter.channelInactive(ChannelInboundHandlerAdapter.java:81) ~[netty-transport-4.1.59.Final.jar:4.1.59.Final]
		at io.netty.handler.codec.http.HttpContentDecoder.channelInactive(HttpContentDecoder.java:235) ~[netty-codec-http-4.1.59.Final.jar:4.1.59.Final]
		at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:262) ~[netty-transport-4.1.59.Final.jar:4.1.59.Final]
		at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:248) ~[netty-transport-4.1.59.Final.jar:4.1.59.Final]
		at io.netty.channel.AbstractChannelHandlerContext.fireChannelInactive(AbstractChannelHandlerContext.java:241) ~[netty-transport-4.1.59.Final.jar:4.1.59.Final]
		at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelInactive(CombinedChannelDuplexHandler.java:418) ~[netty-transport-4.1.59.Final.jar:4.1.59.Final]
		at io.netty.handler.codec.ByteToMessageDecoder.channelInputClosed(ByteToMessageDecoder.java:389) ~[netty-codec-4.1.59.Final.jar:4.1.59.Final]
		at io.netty.handler.codec.ByteToMessageDecoder.channelInactive(ByteToMessageDecoder.java:354) ~[netty-codec-4.1.59.Final.jar:4.1.59.Final]
		at io.netty.handler.codec.http.HttpClientCodec$Decoder.channelInactive(HttpClientCodec.java:311) ~[netty-codec-http-4.1.59.Final.jar:4.1.59.Final]
		at io.netty.channel.CombinedChannelDuplexHandler.channelInactive(CombinedChannelDuplexHandler.java:221) ~[netty-transport-4.1.59.Final.jar:4.1.59.Final]
		at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:262) ~[netty-transport-4.1.59.Final.jar:4.1.59.Final]
		at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:248) ~[netty-transport-4.1.59.Final.jar:4.1.59.Final]
		at io.netty.channel.AbstractChannelHandlerContext.fireChannelInactive(AbstractChannelHandlerContext.java:241) ~[netty-transport-4.1.59.Final.jar:4.1.59.Final]
		at io.netty.handler.codec.ByteToMessageDecoder.channelInputClosed(ByteToMessageDecoder.java:389) ~[netty-codec-4.1.59.Final.jar:4.1.59.Final]
		at io.netty.handler.codec.ByteToMessageDecoder.channelInactive(ByteToMessageDecoder.java:354) ~[netty-codec-4.1.59.Final.jar:4.1.59.Final]
		at io.netty.handler.ssl.SslHandler.channelInactive(SslHandler.java:1121) ~[netty-handler-4.1.59.Final.jar:4.1.59.Final]
		at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:262) ~[netty-transport-4.1.59.Final.jar:4.1.59.Final]
		at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:248) ~[netty-transport-4.1.59.Final.jar:4.1.59.Final]
		at io.netty.channel.AbstractChannelHandlerContext.fireChannelInactive(AbstractChannelHandlerContext.java:241) ~[netty-transport-4.1.59.Final.jar:4.1.59.Final]
		at io.netty.channel.DefaultChannelPipeline$HeadContext.channelInactive(DefaultChannelPipeline.java:1405) ~[netty-transport-4.1.59.Final.jar:4.1.59.Final]
		at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:262) ~[netty-transport-4.1.59.Final.jar:4.1.59.Final]
		at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:248) ~[netty-transport-4.1.59.Final.jar:4.1.59.Final]
		at io.netty.channel.DefaultChannelPipeline.fireChannelInactive(DefaultChannelPipeline.java:901) ~[netty-transport-4.1.59.Final.jar:4.1.59.Final]
		at io.netty.channel.AbstractChannel$AbstractUnsafe$8.run(AbstractChannel.java:819) ~[netty-transport-4.1.59.Final.jar:4.1.59.Final]
		at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:164) ~[netty-common-4.1.59.Final.jar:4.1.59.Final]
		at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:472) ~[netty-common-4.1.59.Final.jar:4.1.59.Final]
		at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:384) ~[netty-transport-native-epoll-4.1.59.Final-linux-x86_64.jar:4.1.59.Final]
		at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989) ~[netty-common-4.1.59.Final.jar:4.1.59.Final]
		at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[netty-common-4.1.59.Final.jar:4.1.59.Final]
		at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[netty-common-4.1.59.Final.jar:4.1.59.Final]
		at java.base/java.lang.Thread.run(Thread.java:832) ~[na:na]
Caused by: reactor.netty.http.client.PrematureCloseException: Connection prematurely closed BEFORE response

Steps to Reproduce

@Test
public void repoCase() {

}

Possible Solution

Your Environment

Aws envioenment : Docker Container using kubernetis Using classic load balancer

  • Reactor version(s) used: 2.4.5
  • Other relevant libraries versions (eg. netty, …):
  • JVM version (java -version): 11
  • OS and version (eg. uname -a):

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 18 (10 by maintainers)

Most upvoted comments

I’ve solved this issue on my Tests with a workaround, by adding following line in the end of each method:

try { Thread.sleep(5000); } catch (InterruptedException e) { throw new RuntimeException(e); }