You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "laywin (via GitHub)" <gi...@apache.org> on 2024/11/07 14:30:56 UTC

[PR] fix judgment for registry configed in DefaultApplicationDeployer [dubbo]

laywin opened a new pull request, #14874:
URL: https://github.com/apache/dubbo/pull/14874

   ## What is the purpose of the change?
   fix  https://github.com/apache/dubbo/issues/14859
   
   ## Checklist
   - [x] Make sure there is a [GitHub_issue](https://github.com/apache/dubbo/issues) field for the change.
   - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
   - [x] Write necessary unit-test to verify your logic correction. If the new feature or significant change is committed, please remember to add sample in [dubbo samples](https://github.com/apache/dubbo-samples) project.
   - [x] Make sure gitHub actions can pass. [Why the workflow is failing and how to fix it?](./CONTRIBUTING.md)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


Re: [PR] fix judgment for registry configed in DefaultApplicationDeployer [dubbo]

Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #14874:
URL: https://github.com/apache/dubbo/pull/14874#issuecomment-2463671000

   ## [Codecov](https://app.codecov.io/gh/apache/dubbo/pull/14874?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   All modified and coverable lines are covered by tests :white_check_mark:
   > Project coverage is 2.19%. Comparing base [(`ef6e8bd`)](https://app.codecov.io/gh/apache/dubbo/commit/ef6e8bd01cef22ef148f1edb67cc1b41af55f4d6?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) to head [(`02c2f20`)](https://app.codecov.io/gh/apache/dubbo/commit/02c2f209193db78e0b20c5b323a4a4f774343c24?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   > Report is 55 commits behind head on 3.3.
   
   <details><summary>Additional details and impacted files</summary>
   
   
   ```diff
   @@              Coverage Diff              @@
   ##              3.3    #14874        +/-   ##
   =============================================
   - Coverage   37.53%     2.19%    -35.34%     
   =============================================
     Files        1813     26083     +24270     
     Lines       80737   1389686   +1308949     
     Branches    12005    220210    +208205     
   =============================================
   + Hits        30304     30570       +266     
   - Misses      46042   1354680   +1308638     
   - Partials     4391      4436        +45     
   ```
   
   </details>
   
   [:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/apache/dubbo/pull/14874?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).   
   :loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


Re: [PR] fix judgment for registry configed in DefaultApplicationDeployer [dubbo]

Posted by "laywin (via GitHub)" <gi...@apache.org>.
laywin commented on code in PR #14874:
URL: https://github.com/apache/dubbo/pull/14874#discussion_r1859759730


##########
dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/deploy/DefaultApplicationDeployer.java:
##########
@@ -782,14 +782,17 @@ public void prepareApplicationInstance(ModuleModel moduleModel) {
         // export MetricsService
         exportMetricsService();
 
-        if (moduleModel.getDeployer().hasRegistryInteraction()) {
+        boolean registryConfiged = CollectionUtils.isNotEmpty(
+                moduleModel.getApplicationModel().getApplicationConfigManager().getRegistries());
+
+        if (registryConfiged) {

Review Comment:
   > Comparing to `hasRegistryInteraction()`, the new condition missed to check the registry configuration that is restricted in ServiceConfig. So this change might fix the registration issue for users programmatically using API but probably will cause new issue for users exporting services the other way.
   
   i think it should to start the registry schedule if there is a registry config in application config. because service export may happens after dubbo started, so the instance can't be registry. 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


Re: [PR] fix judgment for registry configed in DefaultApplicationDeployer [dubbo]

Posted by "AlbumenJ (via GitHub)" <gi...@apache.org>.
AlbumenJ commented on PR #14874:
URL: https://github.com/apache/dubbo/pull/14874#issuecomment-2472610366

   @chickenlj PTAL


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


Re: [PR] fix judgment for registry configed in DefaultApplicationDeployer [dubbo]

Posted by "zrlw (via GitHub)" <gi...@apache.org>.
zrlw commented on PR #14874:
URL: https://github.com/apache/dubbo/pull/14874#issuecomment-4384433018

   @laywin check https://github.com/apache/dubbo/pull/16249


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


Re: [PR] fix judgment for registry configed in DefaultApplicationDeployer [dubbo]

Posted by "chickenlj (via GitHub)" <gi...@apache.org>.
chickenlj commented on code in PR #14874:
URL: https://github.com/apache/dubbo/pull/14874#discussion_r1859653304


##########
dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/deploy/DefaultApplicationDeployer.java:
##########
@@ -782,14 +782,17 @@ public void prepareApplicationInstance(ModuleModel moduleModel) {
         // export MetricsService
         exportMetricsService();
 
-        if (moduleModel.getDeployer().hasRegistryInteraction()) {
+        boolean registryConfiged = CollectionUtils.isNotEmpty(
+                moduleModel.getApplicationModel().getApplicationConfigManager().getRegistries());
+
+        if (registryConfiged) {

Review Comment:
   Comparing to `hasRegistryInteraction()`, the new condition missed to check the registry configuration that is restricted in ServiceConfig. So this change might fix the registration issue for users programmatically using API but probably will cause new issue for users exporting services the other way.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


Re: [PR] fix judgment for registry configed in DefaultApplicationDeployer [dubbo]

Posted by "laywin (via GitHub)" <gi...@apache.org>.
laywin closed pull request #14874: fix judgment for registry configed in DefaultApplicationDeployer
URL: https://github.com/apache/dubbo/pull/14874


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org