Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@zidoshare
Copy link

@zidoshare zidoshare commented Apr 1, 2021

Describe what this PR does / why we need it

当资源数大于2000时限流不可用

Does this pull request fix one issue?

Fixed #2108

Describe how you did it

  1. 当资源数目大于限制数量时,清理空闲资源
  2. 提供csp.sentinel.context.max.size用于资源数量上限

Describe how to verify it

编写相关测试

Special notes for reviews

@sczyh30

Comment on lines +113 to +115
if (maxContextNameSize < 0) {
maxContextNameSize = DEFAULT_MAX_CONTEXT_NAME_SIZE;
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe log a warning message here to tell the user that we had overwritten the maxContextNameSize value

Copy link
Author

Choose a reason for hiding this comment

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

I need a standard warning message

Comment on lines +116 to +118
} catch (Exception ex) {
maxContextNameSize = DEFAULT_MAX_CONTEXT_NAME_SIZE;
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

log an error message here?

Copy link
Author

Choose a reason for hiding this comment

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

In fact, I wrote it with reference to the resolveAppType method. There is no warning message in the resolveAppType method

Comment on lines +73 to 75

private static int maxContextNameSize = DEFAULT_MAX_CONTEXT_NAME_SIZE;

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we should name it maxContextSize

Copy link
Author

Choose a reason for hiding this comment

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

It named MAX_CONTEXT_NAME_SIZE in com.alibaba.csp.sentinel.Constants

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@sczyh30 sczyh30 added this to the v2.0.0 milestone Jun 6, 2023
@sczyh30 sczyh30 requested review from LearningGp and sczyh30 June 6, 2023 02:46
@LearningGp
Copy link
Collaborator

Due to this PR's inactivity and the unsigned CLA, we are temporarily closing it. Feel free to create a new PR if you still intend to contribute after addressing the CLA requirement.

@LearningGp LearningGp closed this Oct 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/enhancement Category issues or prs related to enhancement. to-review To review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

提供maxContextNameSize设置选项,对于超出限量的资源优先清理空闲

5 participants