pjfanning commented on code in PR #776:
URL: https://github.com/apache/pekko-http/pull/776#discussion_r2347278777
##########
http-core/src/main/scala/org/apache/pekko/http/javadsl/settings/ConnectionPoolSettings.scala:
##########
@@ -37,7 +36,7 @@ abstract class ConnectionPoolSettings private[pekko] () {
self: ConnectionPoolSe
def getMaxRetries: Int = maxRetries
def getMaxOpenRequests: Int = maxOpenRequests
def getPipeliningLimit: Int = pipeliningLimit
- def getMaxConnectionLifetime: JDuration = maxConnectionLifetime.asJava
+ def getMaxConnectionLifetime: JDuration =
JDuration.ofNanos(maxConnectionLifetime.toNanos)
Review Comment:
Basically we have a bug in pekko.util.JavaDurationConverters.
It allows you to compile:
```
import pekko.util.JavaDurationConverters._
scala.concurrent.duration.Duration.Inf.asJava
```
But this will fail at runtime because pekko.util.JavaDurationConverters
calls toNanos on the scala duration and this fails with
```
java.lang.IllegalArgumentException: toNanos not allowed on infinite Durations
at scala.concurrent.duration.Duration$Infinite.fail(Duration.scala:219)
```
I'm going to park this PR for a while - and concentrate on fixing the bug.
I think pekko.util.JavaDurationConverters should return the max possible
Java Duration because Java Duration does not support infinite.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]