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

Changes the silent connection timeouts to consider full-duplex communication flow #3616

Closed
wants to merge 2 commits into from

Conversation

thsfs
Copy link
Contributor

@thsfs thsfs commented Dec 15, 2021

The first implementation wrongly considered the communication to be half-duplex, so talking-only connections were getting shutdown as the checking time was only being set for the async_read() function. The new implementation considers now the silent connections to be when there is no communication in any of both directions.

This PR also changes the the silent/drop procedure to be applicable only to the server-side. The nano::socket class was changed to get informed on its constructor about the endpoint_type that can be either socket or client.

@thsfs thsfs changed the base branch from develop to releases/v23 December 15, 2021 21:39
@thsfs thsfs self-assigned this Dec 15, 2021
clemahieu
clemahieu previously approved these changes Dec 16, 2021
theohax
theohax previously approved these changes Dec 16, 2021
Copy link
Contributor

@theohax theohax left a comment

Choose a reason for hiding this comment

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

Looks good, it's basically a symmetric thing of what was already being done for the receive, right?

@thsfs
Copy link
Contributor Author

thsfs commented Dec 16, 2021

Looks good, it's basically a symmetric thing of what was already being done for the receive, right?

Yes, that is right.

@theohax
Copy link
Contributor

theohax commented Dec 18, 2021

@thsfs is this ready to merge?

@dsiganos
Copy link
Contributor

I suspect this is dead. Thiago is working on another solution that will focus on silence on tcp server side only.

@thsfs
Copy link
Contributor Author

thsfs commented Dec 18, 2021

I suspect this is dead. Thiago is working on another solution that will focus on silence on tcp server side only.

I'm intending to append a complement to this. It will check for is_server () instead of type == realtime, plus the related code for ensuring the socket runs on the server-side.

@thsfs thsfs marked this pull request as draft December 18, 2021 17:35
@thsfs thsfs force-pushed the outgoing_data_fix branch from b7066d2 to a9b2bba Compare December 20, 2021 19:34
@thsfs thsfs marked this pull request as ready for review December 20, 2021 19:34
@thsfs thsfs requested review from clemahieu and theohax December 20, 2021 19:34
@thsfs thsfs dismissed stale reviews from clemahieu and theohax December 20, 2021 19:43

Dismissed after new changes.

auto is_silent = [this_l] (auto const & time) {
auto const silent_for_receiving = (time - this_l->last_receive_time_or_init) > this_l->silent_connection_tolerance_time.count ();
auto const silent_for_sending = (time - this_l->last_send_time_or_init) > this_l->silent_connection_tolerance_time.count ();
return silent_for_receiving && silent_for_sending;
Copy link
Contributor

@dsiganos dsiganos Dec 21, 2021

Choose a reason for hiding this comment

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

This silent_for_receiving && silent_for_sending shouldn't be an "AND" relationship.
It should at least be an OR relationship but I am not sure if we have a guaranteed minimum reply gap.

@zhyatt zhyatt added this to the V23.0 milestone Dec 21, 2021
@zhyatt zhyatt added the bug label Dec 21, 2021
@thsfs
Copy link
Contributor Author

thsfs commented Dec 21, 2021

Replaced by: #3623

@thsfs thsfs closed this Dec 21, 2021
@zhyatt zhyatt removed this from the V23.0 milestone Dec 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants