[ 
https://issues.apache.org/jira/browse/KNOX-3591?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18146738#comment-18146738
 ] 

ASF subversion and git services commented on KNOX-3591:
-------------------------------------------------------

Commit 6c5d3a483fcb40cb47ef35046ca7bc0873b6610d in knox's branch 
refs/heads/master from Sandor Molnar
[ https://gitbox.apache.org/repos/asf?p=knox.git;h=6c5d3a483 ]

KNOX-3591: Make the KnoxIDF resources @Singleton (#1525)

> 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: 20m
>  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)

Reply via email to