Skip to content

Conversation

@zrlw
Copy link
Contributor

@zrlw zrlw commented Jun 16, 2025

What is the purpose of the change?

the channel initialization is triggered by method performConnect, so performConnect should not check connectionPrefaceReceivedPromiseRef and set connectionPrefaceReceivedPromise, they should be created at ChannelInitializer#initChannel.
0f234fad6e98669fa72f62d7bb99b080

Checklist

  • Make sure there is a GitHub_issue field for the change.
  • 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. If the new feature or significant change is committed, please remember to add sample in dubbo samples project.
  • Make sure gitHub actions can pass. Why the workflow is failing and how to fix it?

@zrlw
Copy link
Contributor Author

zrlw commented Jun 16, 2025

@oxsean PTAL

@zrlw zrlw force-pushed the 3.3-waitBootStrapInited branch 2 times, most recently from 69740ee to f0483f5 Compare June 16, 2025 05:34
@zrlw zrlw changed the title [3.3] Await bootstrap initialization to ensure http2 client connection preface mechanism could work properly [3.3] Await channel initialization to ensure http2 client connection preface mechanism could work properly Jun 16, 2025
@codecov-commenter
Copy link

codecov-commenter commented Jun 16, 2025

Codecov Report

Attention: Patch coverage is 68.75000% with 10 lines in your changes missing coverage. Please review.

Project coverage is 60.95%. Comparing base (71f7600) to head (d3a3790).
Report is 7 commits behind head on 3.3.

Files with missing lines Patch % Lines
...moting/transport/netty4/NettyConnectionClient.java 68.75% 7 Missing and 3 partials ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##                3.3   #15460      +/-   ##
============================================
+ Coverage     60.91%   60.95%   +0.04%     
- Complexity    11447    11452       +5     
============================================
  Files          1888     1888              
  Lines         86363    86382      +19     
  Branches      12956    12961       +5     
============================================
+ Hits          52606    52656      +50     
+ Misses        28317    28292      -25     
+ Partials       5440     5434       -6     
Flag Coverage Δ
integration-tests-java17 33.05% <40.62%> (-0.05%) ⬇️
integration-tests-java8 33.15% <40.62%> (-0.13%) ⬇️
samples-tests-java17 31.46% <40.62%> (+<0.01%) ⬆️
samples-tests-java8 29.39% <40.62%> (+0.04%) ⬆️
unit-tests 58.86% <68.75%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@zrlw zrlw force-pushed the 3.3-waitBootStrapInited branch from f0483f5 to 3c5a3ed Compare June 16, 2025 06:55
Copy link
Contributor

@oxsean oxsean left a comment

Choose a reason for hiding this comment

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

Please check the comments.

* the countdown latch for
* {@link org.apache.dubbo.remoting.transport.netty4.NettyConnectionClient#isChannelInitialized}
*/
private CountDownLatch channelInitializedLatch;
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not use AtomicReference<Promise> to keeping the same synchronous style?

Promise<Void> connectionPrefaceReceivedPromise = connectionPrefaceReceivedPromiseRef.get();
if (connectionPrefaceReceivedPromise != null) {
// await channel initialization to ensure connection preface received promise had been created when necessary.
if (!isChannelInitialized) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need to consider reconnection as well?

@zrlw zrlw requested a review from oxsean June 18, 2025 23:25
Copy link
Contributor

@oxsean oxsean left a comment

Choose a reason for hiding this comment

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

LGTM.

@zrlw zrlw merged commit b85111e into apache:3.3 Jun 23, 2025
29 checks passed
@zrlw zrlw deleted the 3.3-waitBootStrapInited branch June 24, 2025 07:38
@zrlw
Copy link
Contributor Author

zrlw commented Jul 31, 2025

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.

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.

3 participants