Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MINOR][0.7] Avoid returning null in defaultUserApps when quota file does't config user #822

Merged
merged 1 commit into from
Apr 14, 2023

Conversation

smallzhongfeng
Copy link
Contributor

What changes were proposed in this pull request?

map.getOrDefault() => map.computeIfAbsent()

Why are the changes needed?

If do not define the user and app num in the quota configuration file, it will appear that the defaultUserApps does not have the corresponding app number for this user, because we did not include the quotaAppNum in the defaultUserApps.

before :
The log from coordinator is [ERROR] 2023-03-28 19:24:11,18 Grpc-260 AccessAppQuotaChecker check - Denied by AccessAppQuotaChecker => User: xxxx, current app num is: 3, default app num is: null.

after :
The log from coordinator is [ERROR] 2023-03-31 14:32:21,228 Grpc-240 AccessAppQuotaChecker check - Denied by AccessAppQuotaChecker => User: xxxx, current app num is: 3, default app num is: 3.

Does this PR introduce any user-facing change?

No.

How was this patch tested?

Origin uts.

@smallzhongfeng
Copy link
Contributor Author

PTAL. @jerqi Thanks!

@codecov-commenter
Copy link

codecov-commenter commented Apr 14, 2023

Codecov Report

Merging #822 (48c4246) into branch-0.7 (bcb591e) will not change coverage.
The diff coverage is 100.00%.

@@              Coverage Diff              @@
##             branch-0.7     #822   +/-   ##
=============================================
  Coverage         60.78%   60.78%           
- Complexity         1792     1793    +1     
=============================================
  Files               214      214           
  Lines             12374    12374           
  Branches           1045     1045           
=============================================
  Hits               7521     7521           
  Misses             4449     4449           
  Partials            404      404           
Impacted Files Coverage Δ
...a/org/apache/uniffle/coordinator/QuotaManager.java 85.29% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Contributor

@jerqi jerqi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks @smallzhongfeng merged.

@jerqi jerqi merged commit 71a9c7a into apache:branch-0.7 Apr 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants