[
https://issues.apache.org/jira/browse/KNOX-3591?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Sandor Molnar resolved KNOX-3591.
---------------------------------
Resolution: Fixed
> 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
> Priority: Major
> Fix For: 3.1.0
>
> Time Spent: 0.5h
> Remaining Estimate: 0h
>
> {{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)