reactor-netty: Connection prematurely closed cause by the firewalls and target servers idle timeout

I get prematurely closed connections when using reactor-netty in certain scenarios.

The error happens only when doing simultaneous calls to several back-end services with Springs WebClient. I do such calls once per minute but the error does not occur every time.

The same happend with older versions, too (reactor Bismuth and spring boot < 2.1.0 and corresponding netty versions). With the current version the errors are more frequent (and the error message is different). With the old version I had about one error every ten minutes, now I have one every three to five minutes.

There seems to be some concurrency issue because the error only shows up when doing these simultaneous calls. There are no errors when calling the back-end services otherwise.

Sorry for the meager description but I don’t have much more details yet. Might be related to https://github.com/reactor/reactor-netty/issues/413

Expected behavior

Exception shouldn’t happen.

Actual behavior

2018-11-06 16:02:23.511 ERROR [-client-epoll-8] r.n.r.PooledConnectionProvider : [id: 0x97c1f1ad, L:/192.168.0.yyy:yyyyy ! R:192.168.0.xxx/192.168.0.xxx:xxxxx] Pooled connection observed an error

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

Steps to reproduce

I don’t have any test code to reproduce this.

I do the calls by using Mono.zip to execute the calls concurrently: public static <R> Mono<R> zip(final Iterable<? extends Mono<?>> monos, Function<? super Object[], ? extends R> combinator)

Reactor Netty version

  • reactor-netty 0.8.2
  • netty 4.1.29.Final
  • ~spring-cloud.version: Finchley.SR2~
  • reactor.version: Californium-SR2 (3.2.2)
  • spring boot 2.1.0

Same issue, with different error message, happens with earlier versions, too.

JVM version (e.g. java -version)

java version “1.8.0_181” Java™ SE Runtime Environment (build 1.8.0_181-b13) Java HotSpot™ 64-Bit Server VM (build 25.181-b13, mixed mode)

OS version (e.g. uname -a)

Linux 4.15.18-2-pve #1 SMP PVE 4.15.18-20 (Thu, 16 Aug 2018 11:06:35 +0200) x86_64 GNU/Linux

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 18 (7 by maintainers)

Most upvoted comments

Misunderstood and thought the check interval was referring to some built-in connection check 😬 Sorry and thanks : )

@violetagg, I tried running the crawler using 0.8.4.BUILD-SNAPSHOT and using the pooled connector for a couple of hours. So far, I have not encountered the issue.

@georgmittendorfer For disabling connection pool use:

0.7.x

HttpClient.create(opt -> opt.disablePool());

0.8.x

HttpClient.create(ConnectionProvider.newConnection());

I’m closing the issue you can reopen it fi you have more information for the problem.

Regards, Violeta