You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "zrlw (via GitHub)" <gi...@apache.org> on 2025/06/16 03:33:03 UTC

[PR] [3.3] Await bootstrap initialization to ensure http2 client connection preface mechanism could work properly [dubbo]

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

   ## What is the purpose of the change?
   Http2 client connection preface mechanism will be bypassed when thread 1 which is running performConnect is faster than thread 2 which is running bootstrap initialization. 
   ![0f234fad6e98669fa72f62d7bb99b080](https://github.com/user-attachments/assets/25efa32f-cb64-4283-b6fe-bbcade2cc4a4)
   
   ## 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] [3.3] Await channel initialization to ensure http2 client connection preface mechanism could work properly [dubbo]

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

   Current solution - ```processing h2 in netty4 module``` -  is only a temporary measure to minimize the impact on existing code as much as possible, it migh be refactored if there is an opportunity in the future.


-- 
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] [3.3] Await channel initialization to ensure http2 client connection preface mechanism could work properly [dubbo]

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


##########
dubbo-remoting/dubbo-remoting-netty4/src/main/java/org/apache/dubbo/remoting/transport/netty4/NettyConnectionClient.java:
##########
@@ -56,6 +57,17 @@ public final class NettyConnectionClient extends AbstractNettyConnectionClient {
 
     private AtomicReference<Promise<Void>> connectionPrefaceReceivedPromiseRef;
 
+    /**
+     * await connection preface only after the channel was initialized.
+     */
+    private boolean isChannelInitialized;
+
+    /**
+     * the countdown latch for
+     * {@link org.apache.dubbo.remoting.transport.netty4.NettyConnectionClient#isChannelInitialized}
+     */
+    private CountDownLatch channelInitializedLatch;

Review Comment:
   Why not use AtomicReference<Promise<Object>> to keeping the same synchronous style?



##########
dubbo-remoting/dubbo-remoting-netty4/src/main/java/org/apache/dubbo/remoting/transport/netty4/NettyConnectionClient.java:
##########
@@ -154,23 +171,22 @@ protected void doConnect() throws RemotingException {
      * @param start start time of doConnect in milliseconds.
      */
     private void waitConnectionPreface(long start) throws RemotingException {
-        if (connectionPrefaceReceivedPromiseRef == null) {
-            return;
-        }
-        Promise<Void> connectionPrefaceReceivedPromise = connectionPrefaceReceivedPromiseRef.get();
-        if (connectionPrefaceReceivedPromise != null) {
+        // await channel initialization to ensure connection preface received promise had been created when necessary.
+        if (!isChannelInitialized) {

Review Comment:
   Do we need to consider reconnection as well?



-- 
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] [3.3] Await bootstrap initialization to ensure http2 client connection preface mechanism could work properly [dubbo]

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

   @oxsean 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] [3.3] Await channel initialization to ensure http2 client connection preface mechanism could work properly [dubbo]

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

   ## [Codecov](https://app.codecov.io/gh/apache/dubbo/pull/15460?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   Attention: Patch coverage is `29.41176%` with `12 lines` in your changes missing coverage. Please review.
   > Project coverage is 31.50%. Comparing base [(`71f7600`)](https://app.codecov.io/gh/apache/dubbo/commit/71f760015e458cc4a572011360306a0d27cf2e2d?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) to head [(`f0483f5`)](https://app.codecov.io/gh/apache/dubbo/commit/f0483f5837ebcb5eb64c5ab4c5a62de6c4251329?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   
   | [Files with missing lines](https://app.codecov.io/gh/apache/dubbo/pull/15460?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
   |---|---|---|
   | [...moting/transport/netty4/NettyConnectionClient.java](https://app.codecov.io/gh/apache/dubbo/pull/15460?src=pr&el=tree&filepath=dubbo-remoting%2Fdubbo-remoting-netty4%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fdubbo%2Fremoting%2Ftransport%2Fnetty4%2FNettyConnectionClient.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-ZHViYm8tcmVtb3RpbmcvZHViYm8tcmVtb3RpbmctbmV0dHk0L3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9yZW1vdGluZy90cmFuc3BvcnQvbmV0dHk0L05ldHR5Q29ubmVjdGlvbkNsaWVudC5qYXZh) | 29.41% | [10 Missing and 2 partials :warning: ](https://app.codecov.io/gh/apache/dubbo/pull/15460?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   
   > :exclamation:  There is a different number of reports uploaded between BASE (71f7600) and HEAD (f0483f5). Click for more details.
   > 
   > <details><summary>HEAD has 3 uploads less than BASE</summary>
   >
   >| Flag | BASE (71f7600) | HEAD (f0483f5) |
   >|------|------|------|
   >|integration-tests-java8|1|0|
   >|integration-tests-java17|1|0|
   >|unit-tests|1|0|
   ></details>
   
   <details><summary>Additional details and impacted files</summary>
   
   
   ```diff
   @@              Coverage Diff              @@
   ##                3.3   #15460       +/-   ##
   =============================================
   - Coverage     60.91%   31.50%   -29.41%     
   + Complexity    11447     9646     -1801     
   =============================================
     Files          1888     1888               
     Lines         86363    86375       +12     
     Branches      12956    12959        +3     
   =============================================
   - Hits          52606    27214    -25392     
   - Misses        28317    55064    +26747     
   + Partials       5440     4097     -1343     
   ```
   
   | [Flag](https://app.codecov.io/gh/apache/dubbo/pull/15460/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [integration-tests-java17](https://app.codecov.io/gh/apache/dubbo/pull/15460/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [integration-tests-java8](https://app.codecov.io/gh/apache/dubbo/pull/15460/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [samples-tests-java17](https://app.codecov.io/gh/apache/dubbo/pull/15460/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `31.44% <29.41%> (-0.01%)` | :arrow_down: |
   | [samples-tests-java8](https://app.codecov.io/gh/apache/dubbo/pull/15460/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `29.27% <29.41%> (-0.08%)` | :arrow_down: |
   | [unit-tests](https://app.codecov.io/gh/apache/dubbo/pull/15460/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   </details>
   
   [:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/apache/dubbo/pull/15460?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).
   
   <details><summary> :rocket: New features to boost your workflow: </summary>
   
   - :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
   - :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
   </details>


-- 
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] [3.3] Await channel initialization to ensure http2 client connection preface mechanism could work properly [dubbo]

Posted by "zrlw (via GitHub)" <gi...@apache.org>.
zrlw merged PR #15460:
URL: https://github.com/apache/dubbo/pull/15460


-- 
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