UAA perform badly on authorizing/issuing token with multiple concurrent users ( 2000 concurrent users)
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 35/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- java
- Ambito
- authentication, authorization, performance
Direzione di ricerca
Inizia in UaaAuthorizationEndpoint.java, su getAccessTokenForImplicitGrantOrHybrid, e rivedi il blocco implicitLock sincronizzato insieme alla issue collegata di Spring Security. Determina se il lock è ancora necessario per implicit and hybrid authorization-code grants, quindi valida la modifica rispetto alle prestazioni di concorrenza e al comportamento in presenza di race condition.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
What version of UAA are you running?
We use cloudfoundry-identity-uaa-4.14.0.war
How are you deploying the UAA?
In production environment, we have deployed UAA in Tomcat 8. We have 3 UAA nodes running with a Load Balancer to forward requests. We use F5 APM as IDP
What did you expect to see? What goal are you trying to achieve with the UAA?
We have 3185814 records in users table, 5434714 records in Groups table and 6266156 records in group_membership table.
We are working on performance testing and expect UAA to authorize / issue token below 2 seconds with 2000 concurrent users.
What did you see instead?
- We are experiencing UAA performance issues. Authorize / issue token process takes about 8 – 11 seconds with the 2000 concurrent users.
- We have narrowed down the UAA code and found the synchronized code block in UaaAuthorizationEndpoint.java is the bottleneck for multi threads.
- This code seems to be a copy of code from spring framework - https://github.com/spring-projects/spring-security-oauth/blob/20903ff56bbea896c7f2709f61dc6cf1c5b6b8ef/spring-security-oauth2/src/main/java/org/springframework/security/oauth2/provider/endpoint/AuthorizationEndpoint.java#L271.
- We came across this defect reporting performance issues in the same synchronized block in Spring framework too. Here is the defect - https://github.com/spring-projects/spring-security-oauth/issues/1191 for spring framework.
- As per the comments in the code, it seems like ImplicitGrantService caused race condition which is now deprecated and ImplicitRequestToken is being used instead.
So, would it make sense to remove “synchronized” block here since “ImplicitGrantService” has been deprecated?
Here is the code:
private OAuth2AccessToken getAccessTokenForImplicitGrantOrHybrid(TokenRequest tokenRequest, OAuth2Request storedOAuth2Request, OAuth2Request storedOAuth2Request, String grantType ) throws OAuth2Exception { // These 1 method calls have to be atomic, otherwise the ImplicitGrantService can have a race condition //where // one thread removes the token request before another has a chance to redeem it. synchronized (this.implicitLock) { switch (grantType) { case "implicit": return getTokenGranter().grant(grantType, new ImplicitTokenRequest(tokenRequest, storedOAuth2Request)); case "authorization_code": return getHybridTokenGranterForAuthCode().grant(grantType, new ImplicitTokenRequest(tokenRequest, storedOAuth2Request)); default: throw new OAuth2Exception(OAuth2Exception.INVALID_GRANT); } } }
- Lingua principale
- Java
- Stelle
- 1.6k
- Fork
- 847
- Merge medio
- 2g 1h
- PR unite (30g)
- 48
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di cloudfoundry/uaa
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100
cloudfoundry/uaa#4194 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
cloudfoundry/uaa#4189 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
cloudfoundry/uaa#4156 ·
I maintainer di solito rispondono entro 1 giorno
-
Support named allowed-resource policies for mTLS clientsForse già presa @strehle l’ha presa 24 giorni fa. Aperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
cloudfoundry/uaa#4125 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 52/100
cloudfoundry/uaa#4086 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di cloudfoundry/uaa
Issue simili
-
triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
eclipse-edc/IdentityHub#1296 ·
I maintainer di solito rispondono entro 1 giorno
-
ui: 進捗状況線ダイアログが日本語表示で英語のままApertaarea: ui priority: medium
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
tetsuji16/microProject#1721 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 2 giorni
-
The engine's "loaded, but had errors" message leaves out which library and line each error is inAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
cqframework/clinical_quality_language#1980 ·
I maintainer di solito rispondono entro 3 giorni
-
windows-sys 0.101.0Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 61/100