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

[ISSUE #11655]fix invalid usage of ProporityQueue in ConfigChangePluginManger #11668

Merged
merged 6 commits into from
Feb 2, 2024

Conversation

lyf712
Copy link
Contributor

@lyf712 lyf712 commented Jan 16, 2024

Please do not create a Pull Request without creating an issue first.

What is the purpose of the change

Fixed an issue #11655 fix invalid usage of ProporityQueue in ConfigChangePluginMaanger

Brief changelog

XX

Verifying this change

XXXX

Follow this checklist to help us incorporate your contribution quickly and easily:

  • Make sure there is a Github issue filed for the change (usually before you start working on it). Trivial changes like typos do not require a Github issue. Your pull request should address just this issue, without pulling in other changes - one PR resolves one issue.
  • Format the pull request title like [ISSUE #123] Fix UnknownException when host config not exist. Each commit in the pull request should have a meaningful subject line and body.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Write necessary unit-test to verify your logic correction, more mock a little better when cross module dependency exist. If the new feature or significant change is committed, please remember to add integration-test in test module.
  • Run mvn -B clean package apache-rat:check findbugs:findbugs -Dmaven.test.skip=true to make sure basic checks pass. Run mvn clean install -DskipITs to make sure unit-test pass. Run mvn clean test-compile failsafe:integration-test to make sure integration-test pass.

@codecov-commenter
Copy link

codecov-commenter commented Jan 16, 2024

Codecov Report

Attention: 11 lines in your changes are missing coverage. Please review.

Comparison is base (849393c) 66.77% compared to head (f519a19) 66.77%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             develop   #11668   +/-   ##
==========================================
  Coverage      66.77%   66.77%           
- Complexity      8825     8832    +7     
==========================================
  Files           1238     1238           
  Lines          40534    40538    +4     
  Branches        4297     4297           
==========================================
+ Hits           27065    27069    +4     
- Misses         11526    11530    +4     
+ Partials        1943     1939    -4     
Files Coverage Δ
...nacos/plugin/config/ConfigChangePluginManager.java 70.21% <73.33%> (-5.40%) ⬇️
...nacos/config/server/aspect/ConfigChangeAspect.java 84.56% <79.41%> (+4.68%) ⬆️

... and 4 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 849393c...f519a19. Read the comment docs.

return false;
}
}
return true;
Copy link
Collaborator

Choose a reason for hiding this comment

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

can replaced with Lambda

@@ -83,8 +84,10 @@ private static void loadConfigChangeServices() {
// map the relationship of pointcut and plugin service
addPluginServiceByPointCut(each);
Copy link
Collaborator

Choose a reason for hiding this comment

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

check service enabled here ,if not enabled,do not add to the final list , and logs should be printed for what we loaded from service loader and what we ignored if service not enabled

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If you load here, it won't be able to fetch dynamically updated config like AuthConfigs?

Copy link
Collaborator

Choose a reason for hiding this comment

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

If you load here, it won't be able to fetch dynamically updated config like AuthConfigs?
ok, you are right, just ignore this comment

ConfigChangePointCutTypes configChangePointCutType) {
PriorityQueue<ConfigChangePluginService> pluginServicePriorityQueue = ConfigChangePluginManager
.findPluginServiceQueueByPointcut(configChangePointCutType);
List<ConfigChangePluginService> pluginServicePriorityQueue = ConfigChangePluginManager
Copy link
Collaborator

Choose a reason for hiding this comment

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

pluginServicePriorityQueue should be renamed to pluginServicePriorityList

@shiyiyue1102
Copy link
Collaborator

Codecov Report

Attention: 12 lines in your changes are missing coverage. Please review.

Comparison is base (a7d1c35) 66.75% compared to head (a69f5fe) 66.71%.

Additional details and impacted files

pay attention to coverage decline

@shiyiyue1102 shiyiyue1102 merged commit 2bb9398 into alibaba:develop Feb 2, 2024
7 checks passed
huangkemingyyds pushed a commit to huangkemingyyds/nacos that referenced this pull request Feb 20, 2024
…ngePluginManger (alibaba#11668)

* [ISSUE alibaba#11655]fix invalid usage of ProporityQueue in ConfigChangePluginManager

* add UT for config change plugin

* for checkstyle

* for checkstyle
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants