-
Notifications
You must be signed in to change notification settings - Fork 26.6k
[3.3] Await channel initialization to ensure http2 client connection preface mechanism could work properly #15460
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
Conversation
|
@oxsean PTAL |
69740ee to
f0483f5
Compare
Codecov ReportAttention: Patch coverage is
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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…seRef had been created when necessary
f0483f5 to
3c5a3ed
Compare
oxsean
left a comment
There was a problem hiding this 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; |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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?
oxsean
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
|
Current solution - |
What is the purpose of the change?
the channel initialization is triggered by method performConnect, so performConnect should not check

connectionPrefaceReceivedPromiseRefand setconnectionPrefaceReceivedPromise, they should be created at ChannelInitializer#initChannel.Checklist