Skip to content

Reactor netty connection pool drops for no (obvious) reason and hangs. #2031

Description

@marosivanco

Reactor netty connection pool drops for no (obvious) reason. As a consequence, no new HTTP request can be made and the app just hangs.

image

We use these metrics to monitor the pool:
reactor_netty_connection_provider_total_connections
reactor_netty_connection_provider_active_connections
reactor_netty_connection_provider_pending_connections

Expected Behavior

Total should be greater than 0.

Actual Behavior

Total suddenly dropped to 0.

Steps to Reproduce

Do not really know how to reproduce. Seems non-deterministic. It happens approximately once per 2-3 months.
There are no errors in the logs.

webClient
    .post()
    .uri("/a")
    .bodyValue(payload)
	// this seems to be the place, where it hangs (according to the logs)
    .retrieve()
    .bodyToMono(String.class)    
    //...

This is the relevant configuration:

HttpClient httpClient = HttpClient
		.create(ConnectionProvider.builder("apns")
				.lifo()
				.maxConnections(maxConnections)
				.metrics(true)
				// no limit
				.pendingAcquireMaxCount(-1)
				.pendingAcquireTimeout(Duration.ofMillis(Long.MAX_VALUE))
				.build()
		)
		.protocol(HttpProtocol.H2)
		.secure(sslSpec -> sslSpec.sslContext(mutualSslContext()))
		.option(CONNECT_TIMEOUT_MILLIS, connectTimeoutMillis)
		.responseTimeout(Duration.ofMillis(responseTimeoutMillis))
		.proxy(spec -> spec.type(HTTP).host(httpProxyHost).port(httpProxyPort));
}
return builder
		.clientConnector(new ReactorClientHttpConnector(httpClient))
		.baseUrl(serverUrl)
		.filter(new MdcLoggingExchangeFilterFunction())
		.build();

Your Environment

  • Reactor version(s) used:
    reactor-core@3.4.14
    reactor-extra@3.4.6
    reactor-netty-core@1.0.15
    reactor-netty-http@1.0.15
  • Other relevant libraries versions:
    all netty jars @4.1.73
    netty-tcnative-classes@2.0.46
  • JVM version:
    openjdk version "11.0.13" 2021-10-19 LTS
    OpenJDK Runtime Environment 18.9 (build 11.0.13+8-LTS)
    OpenJDK 64-Bit Server VM 18.9 (build 11.0.13+8-LTS, mixed mode, sharing)
  • OS and version: Linux 3.10.0-1160.11.1.el7.x86_64 MonoHttpClientChannel subscribes to Mono with a null subscriber #1 SMP Fri Dec 18 16:34:56 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions