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

Cleanup Socket/SocketPoll 'Limited open Connections' Changes #10265

Merged
merged 2 commits into from
Oct 23, 2024

Conversation

sgothel
Copy link

@sgothel sgothel commented Oct 18, 2024

Summary

Originally contained PR #10270 fixing a regression caused by PR #9916, leading to 100% CPU utilization on idle,
due to WebSocketHandler's checkTimeout not being called and hence no ping sent.

This PR contains remaining cleanups related to PR #9916

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

@sgothel sgothel added the 24.04 label Oct 18, 2024
@sgothel sgothel requested review from mmeeks and caolanm October 18, 2024 17:02
@sgothel sgothel self-assigned this Oct 18, 2024
@sgothel sgothel changed the title Resolves a regression leading to 100% CPU utilization on idle Resolve regression leading to 100% CPU utilization on idle Oct 18, 2024
@sgothel sgothel force-pushed the private/sgothel/conn_limit_idle_fix branch from f97d0ee to 1f4819a Compare October 18, 2024 17:14
@sgothel
Copy link
Author

sgothel commented Oct 18, 2024

Unrelated UT error to this PR (from initial push, pre 1st rebase to master) unit-wopi-languages:

wsd-146207-146523 2024-10-18 17:07:15.561055 +0000 [ docbroker_001 ] TST  UnitWopiLanguages [onDocumentSaved] (+2419ms): Document failed to save| UnitWOPILanguages.cpp:68
wsd-146207-146523 2024-10-18 17:07:15.561069 +0000 [ docbroker_001 ] TST  UnitWopiLanguages [exitTest] (+2419ms): ERROR: FAILURE: exitTest: TestResult::Failed: Failed to save the document (Core is out-of-date or it has a regression: unocommandresult: { "commandName": ".uno:Save", "success": false }| common/Unit.cpp:561
wsd-146207-146523 2024-10-18 17:07:15.561085 +0000 [ docbroker_001 ] TST  UnitWopiLanguages [exitTest] (+2419ms): Dumping state| common/Unit.cpp:567
wsd-146207-146523 2024-10-18 17:07:15.561111 +0000 [ docbroker_001 ] TST  UnitWopiLanguages [endTest] (+2419ms): Ending test by disconnecting 2 connection(s): Failed to save the doc

Not reproduced here locally -> a new instability?

@sgothel
Copy link
Author

sgothel commented Oct 18, 2024

cypress test usual failure writer/invalidations_spec.js

Copy link
Contributor

@mmeeks mmeeks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Socket checkRemoval and handlePoll must be public" - surely they already were - there is no change in their visibility here surely. Please remove this apparently redundant commit that just shuffles code. Fixing the unexpectedly long and poorly wrapped comment on checkRemoval would be good in a follow-up. I'd really prefer to see a single clean fix for the bug at hand that we can merge separated from other stuff.

Similarly - the "WebSocketHandler Logging: Use LOG_DBG for low-frequency ping/pong logging (was LOGA_TRC for high-frequency), use common prefix "Ping:"" - seems like it pops out a lot of underlying channel debugging that should not be necessary. Our websocket & socket channel code has been working extremely well for a long time now - sure if we broke it we need to turn logging on for a bit; the prefix is fine - a debugging patch is fine - but we really shouldn't have great swathes of Pinging going into the logs unless it is enabled. Please use LOGA_DBG if you think it should be a higher level.

I will split out the fix patch I guess so we can merge something fast here.

Copy link
Contributor

@mmeeks mmeeks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the split out fix merged; we have time to improve this I think as per comments.

@sgothel sgothel force-pushed the private/sgothel/conn_limit_idle_fix branch 2 times, most recently from 76cc25c to 6f98df7 Compare October 22, 2024 06:25
@sgothel
Copy link
Author

sgothel commented Oct 22, 2024

"Socket checkRemoval and handlePoll must be public" - surely they already were - there is no change in their visibility here surely. Please remove this apparently redundant commit that just shuffles code. Fixing the unexpectedly long and poorly wrapped comment on checkRemoval would be good in a follow-up. I'd really prefer to see a single clean fix for the bug at hand that we can merge separated from other stuff.

Yes both were public in the base class, yes checkRemoval was also public in StreamSocket
but I rearranged both .. the confusion.

However: StreamSocket::handlePoll was in a protected block, accepted by the compiler.
Socket::handlePoll is public, so shall be StreamSocket::handlePoll's override

Hence this is now a smaller cleanup fix.

Similarly - the "WebSocketHandler Logging: Use LOG_DBG

OK

I will split out the fix patch I guess so we can merge something fast here.

Thanks!

@sgothel sgothel changed the title Resolve regression leading to 100% CPU utilization on idle Cleanup Socket/SocketPoll 'Limited open Connections' Changes Oct 23, 2024
@sgothel sgothel force-pushed the private/sgothel/conn_limit_idle_fix branch from 6f98df7 to c6d5a88 Compare October 23, 2024 06:47
Sven Göthel added 2 commits October 23, 2024 15:09
…override

Signed-off-by: Sven Göthel <[email protected]>
Change-Id: I035ab196e57588513b69894ccc669d88cec488c2
…less `now < getCreationTime()` criteria.

Signed-off-by: Sven Göthel <[email protected]>
Change-Id: I035ab196e57588513b69894ccc669d88cec488c2
@sgothel sgothel force-pushed the private/sgothel/conn_limit_idle_fix branch from c6d5a88 to 79d4d05 Compare October 23, 2024 13:10
@caolanm caolanm merged commit ac9ba4f into master Oct 23, 2024
13 checks passed
@caolanm caolanm deleted the private/sgothel/conn_limit_idle_fix branch October 23, 2024 15:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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