Skip to content

Update AbstractRegistryFactory.java#7528

Closed
yande2011 wants to merge 1 commit intoapache:masterfrom
yande2011:master
Closed

Update AbstractRegistryFactory.java#7528
yande2011 wants to merge 1 commit intoapache:masterfrom
yande2011:master

Conversation

@yande2011
Copy link
Copy Markdown

[bugfix] 创建registry错误时输出错误日志

What is the purpose of the change

Brief changelog

Verifying this change

  • Make sure there is a GitHub_issue field 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 [Dubbo-XXX] Fix UnknownException when host config not exist #XXX. 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 sample in dubbo samples project.
  • Run mvn clean install -DskipTests=false & mvn clean test-compile failsafe:integration-test to make sure unit-test and integration-test pass.
  • If this contribution is large, please follow the Software Donation Guide.

[bugfix] 创建registry错误时输出错误日志
@codecov-io
Copy link
Copy Markdown

Codecov Report

Merging #7528 (2e00127) into master (790dfce) will decrease coverage by 0.52%.
The diff coverage is 50.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #7528      +/-   ##
============================================
- Coverage     59.33%   58.80%   -0.53%     
  Complexity      501      501              
============================================
  Files          1079     1076       -3     
  Lines         43331    43320      -11     
  Branches       6318     6294      -24     
============================================
- Hits          25709    25476     -233     
- Misses        14785    15000     +215     
- Partials       2837     2844       +7     
Impacted Files Coverage Δ Complexity Δ
...ubbo/registry/support/AbstractRegistryFactory.java 86.30% <50.00%> (+2.24%) 0.00 <0.00> (ø)
...a/org/apache/dubbo/rpc/filter/AccessLogFilter.java 26.86% <0.00%> (-52.24%) 0.00% <0.00%> (ø%)
...gcenter/wrapper/CompositeDynamicConfiguration.java 0.00% <0.00%> (-50.00%) 0.00% <0.00%> (ø%)
...va/org/apache/dubbo/rpc/support/AccessLogData.java 53.16% <0.00%> (-37.98%) 0.00% <0.00%> (ø%)
...bo/config/event/listener/LoggingEventListener.java 37.50% <0.00%> (-25.00%) 0.00% <0.00%> (ø%)
...ng/transport/dispatcher/all/AllChannelHandler.java 62.06% <0.00%> (-20.69%) 0.00% <0.00%> (ø%)
...gistry/client/migration/MigrationRuleListener.java 55.88% <0.00%> (-17.65%) 0.00% <0.00%> (ø%)
...bbo/common/bytecode/CustomizedLoaderClassPath.java 28.00% <0.00%> (-16.00%) 0.00% <0.00%> (ø%)
...rg/apache/dubbo/remoting/utils/PayloadDropper.java 76.92% <0.00%> (-15.39%) 0.00% <0.00%> (ø%)
...dubbo/common/status/support/LoadStatusChecker.java 50.00% <0.00%> (-11.54%) 0.00% <0.00%> (ø%)
... and 81 more

Continue to review full report at Codecov.

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

Copy link
Copy Markdown
Contributor

@xiaoheng1 xiaoheng1 left a comment

Choose a reason for hiding this comment

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

What scene will be abnormal?

Copy link
Copy Markdown
Member

@horizonzy horizonzy left a comment

Choose a reason for hiding this comment

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

It just add log info than before, it's not necessary.

@yande2011
Copy link
Copy Markdown
Author

What scene will be abnormal?

when i config a registry but havent add a dependency or cofig for a not exist registry, the exception does not have a log, every thing seem ok from log,but it does not work property actually

@yande2011
Copy link
Copy Markdown
Author

It just add log info than before, it's not necessary.
编码约定
抛出异常的地方不用打印日志,由最终处理异常者决定打印日志的级别,吃掉异常必需打印日志

@horizonzy
Copy link
Copy Markdown
Member

when i config a registry but havent add a dependency or cofig for a not exist registry, the exception does not have a log, every thing seem ok from log,but it does not work property actually

Yes, the log didn't log this situation. It should be enhanced.
But the code can't fix it. The registryFactory is adaptive, the catch code block can't cover it.

@yande2011
Copy link
Copy Markdown
Author

when i config a registry but havent add a dependency or cofig for a not exist registry, the exception does not have a log, every thing seem ok from log,but it does not work property actually

Yes, the log didn't log this situation. It should be enhanced.
But the code can't fix it. The registryFactory is adaptive, the catch code block can't cover it.

Template Method Pattern is used in the registryFactory, i think it is the proper place to log error message.if other classes implement RegistryFactory and override the adaptive method shold log the message itself.

@horizonzy
Copy link
Copy Markdown
Member

Template Method Pattern is used in the registryFactory, i think it is the proper place to log error message.if other classes implement RegistryFactory and override the adaptive method shold log the message itself.

Hi, If you config zookeeper registry without zookeeper-registry dependency, it will throw exception before AbstractRegistryFactory.getRegistry(URL url). You can debug the code at your local machine.

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.

5 participants