From 4fbcbe4905f5cd5063b810678099bf76a4c0d1f6 Mon Sep 17 00:00:00 2001 From: James Roper Date: Mon, 9 Sep 2024 17:00:29 +1000 Subject: [PATCH] docs: http2 ping-timeout clarification (#4420) --- akka-http-core/src/main/resources/reference.conf | 6 ++++-- .../akka/http/scaladsl/settings/Http2ServerSettings.scala | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/akka-http-core/src/main/resources/reference.conf b/akka-http-core/src/main/resources/reference.conf index d7cfc66d1c..f338b78f87 100644 --- a/akka-http-core/src/main/resources/reference.conf +++ b/akka-http-core/src/main/resources/reference.conf @@ -307,7 +307,8 @@ akka.http { ping-interval = 0s # Fail the connection if a sent ping is not acknowledged within this timeout. - # When zero the ping-interval is used, if set the value must be evenly divisible by less than or equal to the ping-interval. + # When set to zero, the ping-interval is used. Otherwise, the value must be less than or equal to the ping-interval, and must be a + # divisor of the ping-interval. ping-timeout = 0s # Limit the number of RSTs a client is allowed to do on one connection, per interval @@ -486,7 +487,8 @@ akka.http { ping-interval = 0s # Fail the connection if a sent ping is not acknowledged within this timeout. - # When zero the ping-interval is used, if set the value must be evenly divisible by less than or equal to the ping-interval. + # When set to zero, the ping-interval is used. Otherwise, the value must be less than or equal to the ping-interval, and must be a + # divisor of the ping-interval. ping-timeout = 0s # The maximum number of times a connections is attempted diff --git a/akka-http-core/src/main/scala/akka/http/scaladsl/settings/Http2ServerSettings.scala b/akka-http-core/src/main/scala/akka/http/scaladsl/settings/Http2ServerSettings.scala index b9dfee9581..4afab7a32b 100644 --- a/akka-http-core/src/main/scala/akka/http/scaladsl/settings/Http2ServerSettings.scala +++ b/akka-http-core/src/main/scala/akka/http/scaladsl/settings/Http2ServerSettings.scala @@ -46,7 +46,7 @@ private[http] object Http2CommonSettings { if (pingInterval > Duration.Zero && pingTimeout > Duration.Zero) { require( pingTimeout <= pingInterval && pingInterval.toMillis % pingTimeout.toMillis == 0, - s"ping-timeout must be less than and evenly divisible by the ping-interval ($pingInterval)") + s"ping-timeout must be less than or equal to and a divisor of the ping-interval ($pingInterval)") } } }