-
Notifications
You must be signed in to change notification settings - Fork 739
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
Private/mmeeks/pollclean #10333
Private/mmeeks/pollclean #10333
Conversation
Signed-off-by: Michael Meeks <[email protected]> Change-Id: I9b998b1934b67c800acd5c41f5d43973fbc20c10
Restores exception guards reduces duplication simplifies code - to use existing disposition logic. fixes unusual branch on function whitespace removes logged warning on timeout removes timeout handling from 'checkRemoval' - timeout does not imply removal; return value needs re-evaluating there. restores checkTimeout in its original location.i - unclear what extra 'setClosed' is good for. also removes 'checkRemoval' from ServerSocket sub-class etc. Signed-off-by: Michael Meeks <[email protected]> Change-Id: Ibb582ec5b2600c7ac7cf3b6aecbee39c43b214f8
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.
Thanks, @mmeeks. Looks great. Restores the original structure and logic. Much more readable too.
@@ -1505,13 +1505,13 @@ bool StreamSocket::checkRemoval(std::chrono::steady_clock::time_point now) | |||
const auto durLast = | |||
std::chrono::duration_cast<std::chrono::milliseconds>(now - getLastSeenTime()); | |||
/// TO Criteria: Violate maximum idle (_pollTimeout default 64s) | |||
const bool isIDLE = _pollTimeout > std::chrono::microseconds::zero() && | |||
durLast > _pollTimeout; | |||
const bool isIdle = _pollTimeout > std::chrono::microseconds::zero() && |
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.
Yes, more than a couple of capitalized letters and it fast becomes obnoxious.
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.
With this re-org virtual Socket::checkRemoval
can be removed and StreamSocket::checkRemoval
a plain method.
I can add this on top.
As discussed, if SigUtil::getTerminationFlag()
checkRemoval
should indeed closeConnection()
right away to be save,
as polling might be stopped as in TerminatingPoll or kitPoll().
Looks great.
Kicked jenkins .. |
Summary
TODO
Checklist
make prettier-write
and formatted the code.make check
make run
and manually verified that everything looks okay