Sandor Molnar created KNOX-3591:
-----------------------------------

             Summary: Make the KnoxIDF resources @Singleton
                 Key: KNOX-3591
                 URL: https://issues.apache.org/jira/browse/KNOX-3591
             Project: Apache Knox
          Issue Type: Bug
          Components: KnoxIDF
            Reporter: Sandor Molnar
            Assignee: Sandor Molnar
             Fix For: 3.1.0


{{jakarta.inject.Singleton}} is not {{{}@Inherited{}}}, so the KnoxIDF 
subclasses of the singleton knoxtoken resources are created per request and run 
{{init()}} on every call. On the token endpoint, that means an uncached gateway 
keystore load under a file lock ({{{}setupPublicCertPEM{}}}) and duplicate 
{{setupTokenStateService}} log lines on each request. It caps RFC 8693 token 
exchange at about 105 req/s locally with 20 threads locally on my Mac.

Fix: add {{@Singleton}} to all KnoxIDF resources except 
{{{}RegistrationResource{}}}. That one keeps per-request state 
({{{}redirectUris{}}}, {{{}allowedScopes{}}}) on the instance, so it stays 
{{{}@RequestScoped{}}}.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to