Timeout: use less resources, clean them up better and make cancellation deterministic - #10254
Merged
Conversation
Al2Klimov
force-pushed
the
Timeout-Cancel
branch
from
November 28, 2024 09:11
144abb1 to
394b2fb
Compare
yhabteab
reviewed
Nov 28, 2024
Al2Klimov
force-pushed
the
Timeout-Cancel
branch
from
November 28, 2024 11:15
394b2fb to
0845bbe
Compare
Al2Klimov
force-pushed
the
Timeout-Cancel
branch
from
November 28, 2024 12:08
0845bbe to
3d3c644
Compare
yhabteab
reviewed
Nov 28, 2024
Al2Klimov
force-pushed
the
Timeout-Cancel
branch
from
November 28, 2024 13:26
3d3c644 to
77edc65
Compare
yhabteab
previously approved these changes
Nov 28, 2024
Al2Klimov
force-pushed
the
Timeout-Cancel
branch
from
November 28, 2024 14:15
77edc65 to
2f96403
Compare
julianbrost
previously requested changes
Nov 28, 2024
julianbrost
left a comment
Member
There was a problem hiding this comment.
Please add some documentation to the class. It now has some non-obvious details, especially regarding what happens at destruction (see #10254 (comment)).
Al2Klimov
commented
Nov 28, 2024
Al2Klimov
force-pushed
the
Timeout-Cancel
branch
from
November 28, 2024 16:06
2f96403 to
af4cceb
Compare
yhabteab
reviewed
Nov 29, 2024
Al2Klimov
force-pushed
the
Timeout-Cancel
branch
2 times, most recently
from
November 29, 2024 13:18
983307f to
9074d78
Compare
Al2Klimov
force-pushed
the
Timeout-Cancel
branch
2 times, most recently
from
November 29, 2024 15:25
cb3068f to
ba63964
Compare
yhabteab
previously approved these changes
Nov 29, 2024
julianbrost
reviewed
Dec 2, 2024
Al2Klimov
force-pushed
the
Timeout-Cancel
branch
from
December 2, 2024 16:03
01f2f7e to
bfb0303
Compare
2 tasks
julianbrost
dismissed
their stale review
December 4, 2024 17:30
The requested changes were addressed, so far I didn't get around to do a full review though.
Member
Author
|
@yhabteab Please could you have yet another look? After all
|
It's not used. Also, the callback shall run completely at once. This ensures that it won't (continue to) run once another coroutine on the strand calls Timeout#Cancel().
…g on multiple threads
…&&), #operator=(const Timeout&), #operator=(Timeout&&)
Al2Klimov
force-pushed
the
Timeout-Cancel
branch
from
January 7, 2025 17:26
bfb0303 to
8f72891
Compare
yhabteab
approved these changes
Jan 8, 2025
Member
There was a problem hiding this comment.
Drop incoming packets on one of the masters port. $ (sudo pfctl -sr 2>/dev/null; echo "block drop in on lo0 proto tcp from any to any port = 5666") | sudo pfctl -e -f - 2>/dev/null
[2025-01-08 10:27:40 +0100] critical/ApiListener: Cannot connect to host 'localhost' on port '5666': Operation canceled [system:89 at /opt/homebrew/include/boost/asio/detail/reactive_socket_connect_op.hpp:97:37 in function 'do_complete']
[2025-01-08 10:27:45 +0100] information/ApiListener: Reconnecting to endpoint 'satellite' via host 'localhost' and port '5666'
...
[2025-01-08 10:28:00 +0100] critical/ApiListener: Timeout while reconnecting to endpoint 'satellite' via host 'localhost' and port '5666', cancelling attempt
[2025-01-08 10:28:00 +0100] critical/ApiListener: Cannot connect to host 'localhost' on port '5666': Operation canceled [system:89 at /opt/homebrew/include/boost/asio/detail/reactive_socket_connect_op.hpp:97:37 in function 'do_complete']
[2025-01-08 10:28:05 +0100] information/ApiListener: Reconnecting to endpoint 'satellite' via host 'localhost' and port '5666'
...
[2025-01-08 10:28:20 +0100] critical/ApiListener: Timeout while reconnecting to endpoint 'satellite' via host 'localhost' and port '5666', cancelling attempt[2025-01-08 10:43:11 +0100] warning/ApiListener: Timeout while processing incoming connection from [::1]:59149Reactivate the standard firewall rules again: $ sudo pfctl -f /etc/pf.conf
julianbrost
approved these changes
Jan 8, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
👍 Now we got unit tests!!! ❤️ 144abb1
👍 Now the destructor leads to cancellation. 21fc946
👍 Now the callback is "atomic", i.e. it doesn't yield. 32e64b6 175099c This way cancellation can't happen in a callback yield, making sure once cancelled, the callback won't (continue to) run. Also, we don't need any coroutine which has to carry around shared pointers which prevent own destruction...
closes #10250
closes #10252