Provider.getService is synchronized, which (I believe) is what is causing threads to block (https://bugs.openjdk.java.net/browse/JDK-7092821). Is there anything that could be done from Spring's side regarding this? Like, for example, caching the Signature instance or providing an aspect that caches the Provider?
I'm running into a behaviour which causes threads to block when verifying RS256-signed JWT tokens. The problem seems to be caused by https://github.com/spring-projects/spring-security-oauth/blob/master/spring-security-jwt/src/main/java/org/springframework/security/jwt/crypto/sign/RsaVerifier.java#L50. Here's a thread dump:
Provider.getService
issynchronized
, which (I believe) is what is causing threads to block (https://bugs.openjdk.java.net/browse/JDK-7092821). Is there anything that could be done from Spring's side regarding this? Like, for example, caching theSignature
instance or providing an aspect that caches theProvider
?