-
Notifications
You must be signed in to change notification settings - Fork 849
Fix inactivity_timeout canceling #1716
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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.
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.
@oknet How about dividing this block to new function like
set_default_inactivity_timeout()?Because, in some cases people want to set
inactivity_timeout_in0. ( One of use cases is drain traffic )And, currently, even if
set_inactivity_timeout()is called fromcancel_inactivity_timeout(), theinactivity_timeout_inwill bedefault_inactivity_timeout. This could accidentally extend inactivity timeout and increase connections, right?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.
In the design of InactivityCop ( before #771 , 6.0.x branch ), any netvc should have a default value for next_inactivity_timeout_at.
InactivityCop::check_inactivity() will call vc->set_inactivity_timeout(HRTIME_SECONDS(default_inactivity_timeout)) to set it if next_inactivity_timeout_at == 0.
And the inactivity_timeout_in will be set to HRTIME_SECONDS(default_inactivity_timeout) in the UnixNetVConnection::set_inactivity_timeout.
The cancel_inactivity_timeout() is useless because the InactivityCop::check_inactivity() will reset next_inactivity_timeout_at to default vaule in the next second.
In the #771 , I do not change the behavior and the design of InactivityCop. But I miss the code in this PR.
@masaori335 Can you create a separate PR for 7.1.x ?
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.
Interesting! Thanks for describing the inactivity cop behaviors. I understood my proposal doesn't make sense.
BTW, #771 is reverted in 7.1.x branch, because of performance issue (see db596a1). Do we still need separate PR for 7.1.x?
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.
Does not need it, since #771 was reverted.
The code changes by this PR is a part of #771 , It was lost during code merge from our internal branch.
Because our internal branch is saved in a separate network, I copy the code from "another screen" to "my local screen".
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.
Got it.
Do you see any performance issue with your internal branch like Miles said on #771? (Half throughputs or doubled connection) If not, I think we should land #771 with this patch in 7.1.0 release. WDYT?