-
Notifications
You must be signed in to change notification settings - Fork 6.1k
Description
Expected Behavior
These classes should use reasonable default timeouts to avoid the possibility of a connection hanging.
Current Behavior
A default RestTemplate with no timeout configured is used.
Context
We had network issues recently and saw hung threads in these classes due to the connections never being released.
It appears that nimbus sets a default timeout on http connections they make: https://www.javadoc.io/static/com.nimbusds/nimbus-jose-jwt/9.37.3/com/nimbusds/jose/jwk/source/JWKSourceBuilder.html#DEFAULT_HTTP_CONNECT_TIMEOUT
Since both of these classes rely on nimbus, perhaps the nimbus timeout settings could be re-used?
After researching this a bit, it does seem I could configure this at the JVM by setting
-Dsun.net.client.defaultConnectTimeout=
-Dsun.net.client.defaultReadTimeout=
but that's more broad than I would prefer.