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

drain: give 5s (configurable) time for existing connections to gracefully close #1157

Merged
merged 1 commit into from
Jun 18, 2024

Conversation

howardjohn
Copy link
Member

@howardjohn howardjohn requested a review from a team as a code owner June 18, 2024 17:16
@howardjohn howardjohn added the release-notes-none Indicates a PR that does not require release notes. label Jun 18, 2024
@istio-testing istio-testing added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jun 18, 2024
Copy link
Contributor

@bleggett bleggett left a comment

Choose a reason for hiding this comment

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

Since we can't actually signal conn termination in either of these cases, this remains incredibly optimistic and in a lot of cases is probably just a waste of cycles - connection is just as likely to self-terminate in 48 hours as it is in 5 mins, from our perspective.

Doesn't hurt tho.

@@ -64,21 +66,36 @@ impl InboundPassthrough {
}

pub(super) async fn run(self) {
let (sub_drain_signal, sub_drain) = drain::channel();
let deadline = self.pi.cfg.self_termination_deadline;
Copy link
Contributor

Choose a reason for hiding this comment

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

At some point we may want separate vars rather than reusing this for everything - it's overloaded with different meanings already.

Also, we probably should have a more robust form of shutdown signaling with a single channel, rather than creating 2-3 different shutdown channels and using them in concert.

That's probably better handled as part of #899 tho.

@istio-testing istio-testing merged commit 46b971f into istio:master Jun 18, 2024
3 checks passed
@howardjohn
Copy link
Member Author

Since we can't actually signal conn termination in either of these cases, this remains incredibly optimistic and in a lot of cases is probably just a waste of cycles - connection is just as likely to self-terminate in 48 hours as it is in 5 mins, from our perspective.

There is IMO a huge difference between 0 and 5s: with 0s, even short lived connections are broken.

if I just curl httpbin.org, its taking ~1s. Without this change it fails, with it it succeeds

@bleggett
Copy link
Contributor

Since we can't actually signal conn termination in either of these cases, this remains incredibly optimistic and in a lot of cases is probably just a waste of cycles - connection is just as likely to self-terminate in 48 hours as it is in 5 mins, from our perspective.

There is IMO a huge difference between 0 and 5s: with 0s, even short lived connections are broken.

if I just curl httpbin.org, its taking ~1s. Without this change it fails, with it it succeeds

If that is behavior we care about, it would probably be best to fence it with a unit test so it doesn't get dropped, and you don't have to manually/personally make sure it's still there 6 months from now.

@howardjohn
Copy link
Member Author

howardjohn commented Jun 19, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-notes-none Indicates a PR that does not require release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants