Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions iocore/net/UnixNetVConnection.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1514,9 +1514,10 @@ UnixNetVConnection::set_inactivity_timeout(ink_hrtime timeout_in)
#else
if (timeout_in == 0) {
Copy link
Contributor Author

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?

Copy link
Member

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 ?

Copy link
Contributor Author

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?

Copy link
Member

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".

Copy link
Contributor Author

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?

// set default inactivity timeout
inactivity_timeout_in = timeout_in = HRTIME_SECONDS(nh->default_inactivity_timeout);
timeout_in = HRTIME_SECONDS(nh->default_inactivity_timeout);
}
next_inactivity_timeout_at = Thread::get_hrtime() + timeout_in;
inactivity_timeout_in = timeout_in;
next_inactivity_timeout_at = Thread::get_hrtime() + inactivity_timeout_in;
#endif
}

Expand Down