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

[Dubbo-5872] use QOS command to check if app service is ready #5873

Merged
merged 2 commits into from
Apr 1, 2020
Merged

[Dubbo-5872] use QOS command to check if app service is ready #5873

merged 2 commits into from
Apr 1, 2020

Conversation

Hinsteny
Copy link
Contributor

What is the purpose of the change

Add one QOS command to check application is ready or not!

Brief changelog

M dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/bootstrap/DubboBootstrap.java
A dubbo-plugin/dubbo-qos/src/main/java/org/apache/dubbo/qos/command/impl/Ready.java
M dubbo-plugin/dubbo-qos/src/main/resources/META-INF/dubbo/internal/org.apache.dubbo.qos.command.BaseCommand
M dubbo-plugin/dubbo-qos/src/test/java/org/apache/dubbo/qos/command/util/CommandHelperTest.java

Verifying this change

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

  • [] 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.

@codecov-io
Copy link

Codecov Report

Merging #5873 into master will decrease coverage by 0.13%.
The diff coverage is 27.77%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #5873      +/-   ##
============================================
- Coverage     61.33%   61.19%   -0.14%     
+ Complexity      500      496       -4     
============================================
  Files           981      982       +1     
  Lines         39147    39165      +18     
  Branches       5645     5648       +3     
============================================
- Hits          24011    23968      -43     
- Misses        12516    12561      +45     
- Partials       2620     2636      +16     
Impacted Files Coverage Δ Complexity Δ
.../apache/dubbo/config/bootstrap/DubboBootstrap.java 52.69% <25.00%> (-1.23%) 0.00 <0.00> (ø)
.../java/org/apache/dubbo/qos/command/impl/Ready.java 50.00% <50.00%> (ø) 0.00 <0.00> (?)
...rg/apache/dubbo/remoting/utils/PayloadDropper.java 46.15% <0.00%> (-30.77%) 0.00% <0.00%> (ø%)
...bo/config/event/listener/LoggingEventListener.java 37.50% <0.00%> (-25.00%) 0.00% <0.00%> (ø%)
...va/org/apache/dubbo/remoting/TimeoutException.java 22.22% <0.00%> (-11.12%) 0.00% <0.00%> (ø%)
...ava/org/apache/dubbo/config/DubboShutdownHook.java 65.21% <0.00%> (-10.87%) 0.00% <0.00%> (ø%)
.../apache/dubbo/rpc/protocol/AsyncToSyncInvoker.java 72.41% <0.00%> (-10.35%) 0.00% <0.00%> (ø%)
.../remoting/transport/netty4/NettyServerHandler.java 59.09% <0.00%> (-9.10%) 0.00% <0.00%> (ø%)
...e/dubbo/remoting/transport/netty/NettyChannel.java 52.27% <0.00%> (-7.96%) 19.00% <0.00%> (-2.00%)
...dubbo/remoting/exchange/support/DefaultFuture.java 79.31% <0.00%> (-6.90%) 0.00% <0.00%> (ø%)
... and 9 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 f8b8b3d...cd118e7. Read the comment docs.

@@ -155,6 +155,8 @@

private AtomicBoolean started = new AtomicBoolean(false);

private AtomicBoolean ready = new AtomicBoolean(true);
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is the default value not false?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sometimes user would not call the DubboBootstrap.start method, so then the app ready function would not working, then the app should ready in default!

@chickenlj
Copy link
Contributor

I think ready should reflect more status than just checking exported services, but still, it's a good start, we can enhance it later.

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.

4 participants