Skip to content
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

Merged
merged 2 commits into from
Oct 27, 2024
Merged

Private/mmeeks/pollclean #10333

merged 2 commits into from
Oct 27, 2024

Conversation

mmeeks
Copy link
Contributor

@mmeeks mmeeks commented Oct 26, 2024

Summary

TODO

  • ...

Checklist

  • I have run make prettier-write and formatted the code.
  • All commits have Change-Id
  • I have run tests with make check
  • I have issued make run and manually verified that everything looks okay
  • Documentation (manuals or wiki) has been updated or is not required

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
@mmeeks mmeeks requested review from Ashod and sgothel October 26, 2024 14:25
Copy link
Contributor

@Ashod Ashod left a 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() &&
Copy link
Contributor

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.

Copy link

@sgothel sgothel left a 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.

@sgothel
Copy link

sgothel commented Oct 26, 2024

Restores exception guards is very good, as checkRemoval also called into _socketHandler->checkTimeout.
While the latter is not a custom user callback, its more save this way.

Kicked jenkins ..

@sgothel sgothel enabled auto-merge (rebase) October 26, 2024 17:36
@sgothel sgothel disabled auto-merge October 26, 2024 17:37
@sgothel sgothel merged commit cebff96 into master Oct 27, 2024
13 checks passed
@sgothel sgothel deleted the private/mmeeks/pollclean branch October 27, 2024 06:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Handle limited open Connections due to keepalive connections (cool#9621)
3 participants