-
Notifications
You must be signed in to change notification settings - Fork 37
Conversation
Hold on a second, there maybe a way to make changes minimum. |
I believe it is the right solution now, ready to review. |
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.
well done!
Wait dutor to have a look |
👌 |
Skimmed through code of the AsyncSocket transport, I think calling You could have a try to verify it. |
emmm. It seems that |
During my test, |
After digging, we found out that, after each RPC call finishes, READ event of the connection will be removed from the event set, so that even the connection is lost the client side won't be able to update the state. So we have to be ask to kernel about the connection state, which is what |
This is because a disconnect from the remove side will incur a READ event on the client side, so the connection IS readable in terms of event handling. |
👍 , let me have a look. |
d888edd
d888edd
to
7d27ebc
Compare
Ready to go, close #411 |
std::shared_ptr<apache::thrift::async::TAsyncSocket> socket; | ||
evb->runImmediatelyOrRunInEventBaseThreadAndWait( | ||
[&socket, evb, host]() { | ||
socket = apache::thrift::async::TAsyncSocket::newSocket( |
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.
Should use tempHost
instead of host
?
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 doesn't matter, actually validate won't change the value of the parameter, so tempHost
will be equal to host
.
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 know what you mean, good catch
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.
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.
Good job
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.
Almost same as #411. Two difference:
readable
will return true while the connection is still working (during my pressure test, it will return true occasionally, once I stop the pressure, no more true is returned), that is probably because it usePOLLIN
, and default read buffer if quite small. AndAsyncSocket::hangup
usePOLLRDHUP | POLLHUP
, which is what we want.ReconnectingRequestChannel::impl()
will be invoked multiple times, and check more than once. After this PR, we manage retry by ourself.@guojun85, PTAL, thx