-
Notifications
You must be signed in to change notification settings - Fork 26.5k
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
fix the bug: the channel will not closed in time when timeout by using telnet in QOS #7282
Conversation
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.
Create a new handler to process this case will be better.
@horizonzy In my opinion, for the reason of uniform code style, I prefer to add the Could you tell me the reason why you think adding a Handler would be better in this case. |
Single responsibility, TelnetProcessHandler just handle the command from client. |
Yeah, I agree with you, but the fact is that |
Hi, I'm not agree with you. |
You are right and enlighten me a lot, now I can see the difference. It is better to use a New Thnks a lot, have a good night ! |
Hi, |
I forgot the commit specifications, plz forgive me. QAQ... |
import org.apache.dubbo.common.logger.Logger; | ||
import org.apache.dubbo.common.logger.LoggerFactory; | ||
|
||
@ChannelHandler.Sharable |
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.
It's not necessary.
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.
if you means the IdleEventHandler
is not necessary, then the p.addLast(new IdleStateHandler(0, 0, 5 * 60));
in QosProcessHandler
may be also not necessary.
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.
it is kind of chinglish? QAQ hh
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.
I mean the annotation @Sharable
.
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.
but why?
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.
It's alway create new TelnetIdleEventHandler
for channel.
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.
Ok, you are right.
import org.apache.dubbo.common.logger.LoggerFactory; | ||
|
||
@ChannelHandler.Sharable | ||
public class IdleEventHandler extends ChannelDuplexHandler { |
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.
The class name use TelnetIdleEventHandler
will be better, what do you think about it.
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.
It is ok. Because when we use HTTP, All HTTP request is HTTP short connection, IdleEventHandler only used for telnet.
Codecov Report
@@ Coverage Diff @@
## master #7282 +/- ##
============================================
- Coverage 59.03% 58.80% -0.24%
Complexity 461 461
============================================
Files 1043 1044 +1
Lines 42445 42411 -34
Branches 6222 6191 -31
============================================
- Hits 25057 24938 -119
- Misses 14587 14661 +74
- Partials 2801 2812 +11 Continue to review full report at Codecov.
|
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
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.
What is the purpose of the change
Fix the bug: don't close the channel when timeout by using telnet in QOS.
see #7281
Brief changelog
When using
IdleStateHandler
withTelnetProcessHandler
in theQosProcessHandler
, the timeout is set to 5*60 seconds, but NO handler deals with theIdleStateEvent
. Maybe theTelnetProcessHandler
should override theuserEventTriggered
method to handle this Event, and close the idle connect.