-
Notifications
You must be signed in to change notification settings - Fork 848
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
Conversation
|
clang format successful! https://ci.trafficserver.apache.org/job/clang-format-github/267/ |
|
RAT check successful! https://ci.trafficserver.apache.org/job/RAT-github/281/ |
|
AU check failed! https://ci.trafficserver.apache.org/job/autest-github/263/ |
|
FreeBSD11 build successful! https://ci.trafficserver.apache.org/job/freebsd-github/1962/ |
|
Intel CC build successful! https://ci.trafficserver.apache.org/job/icc-github/392/ |
|
Linux build successful! https://ci.trafficserver.apache.org/job/linux-github/1854/ |
|
clang-analyzer build failed! https://ci.trafficserver.apache.org/job/clang-analyzer-github/525/ |
|
this keeps next_inactivity_timeout_at = NOW + inactivity_timeout_in. |
|
@oknet I assume your comment still means that you approve this PR? |
|
@zwoop yes, I have marked "approved" on this PR and this is a candidate for v7.1.x. |
|
This has merge conflicts on 7.1.x, maybe because I backed out that other change from @oknet ? Oknet, does this fix the performance issue we saw with that patch? If so, should we redo that on 7.1.x? If not, we'll need a separate 7.1.x PR for this. |
|
I'm marking this for 7.2.0 for now, since I can't safely land this on 7.1.x right now. Please advice :) |
| } else | ||
| inactivity_timeout = 0; | ||
| #else | ||
| if (timeout_in == 0) { |
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_in 0. ( One of use cases is drain traffic )
And, currently, even if set_inactivity_timeout() is called from cancel_inactivity_timeout(), the inactivity_timeout_in will be default_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.
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.
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.
|
If we undo the revert of 771 on 7.1.x (I'm testing now on a prod box, and it's looking better), then we need this right? Lets not forget this :). |
Last few years, we're seeing inactivity_timeout doesn't work as expected in some cases.
Below is some debug logs when
proxy.config.http2.no_activity_timeout_inis set3.It looks like when some read or write is happened, inactivity timeout is updated by a value of
proxy.config.net.default_inactivity_timeout(86400000000000). Is this expected behavior?IMO, a value should be used which is passed by
UnixNetVConnection::set_inactivity_timeout(ink_hrtime timeout_in).With this patch, it works as expected.