UAA perform badly on authorizing/issuing token with multiple concurrent users ( 2000 concurrent users)
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- java
- Lĩnh vực
- authentication, authorization, performance
Hướng nghiên cứu
Bắt đầu trong UaaAuthorizationEndpoint.java tại getAccessTokenForImplicitGrantOrHybrid và xem xét block implicitLock được synchronized cùng với issue Spring Security được liên kết. Xác định liệu lock còn cần thiết cho implicit and hybrid authorization-code grants hay không, sau đó xác thực thay đổi dựa trên hiệu năng đồng thời và hành vi khi xảy ra race condition.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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); } } }
- Ngôn ngữ chính
- Java
- Star
- 1.6k
- Fork
- 847
- Merge trung bình
- 2 ngày 1 giờ
- Pull request đã merge (30 ngày)
- 48
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của cloudfoundry/uaa
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100
cloudfoundry/uaa#4194 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
cloudfoundry/uaa#4189 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
cloudfoundry/uaa#4156 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Support named allowed-resource policies for mTLS clientsCó thể đã có người làm @strehle đã nhận 24 ngày trước. Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
cloudfoundry/uaa#4125 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 52/100
cloudfoundry/uaa#4086 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của cloudfoundry/uaa
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
testng-team/testng#3672 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
eclipse-edc/IdentityHub#1296 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
ui: 進捗状況線ダイアログが日本語表示で英語のままĐang mởarea: ui priority: medium
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
tetsuji16/microProject#1721 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 2 ngày
-
[Bug] [BanyanDB] timestamp.ParseDuration silently drops everything after "d"Có thể đã có người làm @soujasK đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
apache/skywalking#14287 ·
Maintainer thường phản hồi trong vòng 1 ngày