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

Ensure some spawns have deadlines #894

Merged
merged 6 commits into from
Apr 5, 2024

Conversation

bleggett
Copy link
Contributor

@bleggett bleggett commented Apr 5, 2024

  1. TLS handshakes (tokio-rustls) should have a deadline (practically not a big deal for us, but still)

  2. During certain scenarios where workloads are removed, inbound server "graceful shutdown" can deadlock while awaiting http2 server to finish up, leaving the spawned task to hang indefinitely, so add a deadline to that as a safety measure (still looking into why it does, the shutdown part of graceful_shutdown implies a guaranteed termination, but deadline seems safer regardless)

  • Also updates to hyper 1.2.0 (if this is controversial, can drop it)
  • Also drops tokio-console stuff (don't find it terribly useful, also our logrates @ tracelevel tend to overwhelm it, will keep if someone feels strongly)

@bleggett bleggett requested a review from a team as a code owner April 5, 2024 19:47
@istio-testing istio-testing added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Apr 5, 2024
@bleggett bleggett force-pushed the bleggett/minor-fixes branch from 424ef01 to e2187bb Compare April 5, 2024 19:49
@bleggett bleggett requested a review from a team as a code owner April 5, 2024 19:49
bleggett added 3 commits April 5, 2024 15:52
Signed-off-by: Benjamin Leggett <benjamin.leggett@solo.io>
Signed-off-by: Benjamin Leggett <benjamin.leggett@solo.io>
Signed-off-by: Benjamin Leggett <benjamin.leggett@solo.io>
@bleggett bleggett force-pushed the bleggett/minor-fixes branch from e2187bb to e7a03e3 Compare April 5, 2024 19:52
Copy link
Member

@howardjohn howardjohn left a comment

Choose a reason for hiding this comment

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

lgtm

let drain = std::pin::Pin::new(&mut server);
drain.graceful_shutdown();
server.await
// There are scenarios where the http2 server never resolves after
// `graceful_shutdown`, which will hang the whole task.
Copy link
Member

Choose a reason for hiding this comment

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

Interesting. So before inpod, drain was the entire process shutting down. Now its not, so it MUST terminate in some bounded time.

Do we want this here, or at the inpod layer?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do we want this here, or at the inpod layer?

I'm not sure where else to put it, but in terms of error reporting this seems best - this task is spawned to run to completion, and the inpod layer already initiates the drain and waits for it, the most it can do is drop the drain.

(we could do spawnhandles and aborts and punch this up a layer I guess, but the effect would be the same)

src/tls/workload.rs Outdated Show resolved Hide resolved
Signed-off-by: Benjamin Leggett <benjamin.leggett@solo.io>
@bleggett
Copy link
Contributor Author

bleggett commented Apr 5, 2024

/retest

Signed-off-by: Benjamin Leggett <benjamin.leggett@solo.io>
@istio-testing istio-testing merged commit a46575c into istio:master Apr 5, 2024
3 checks passed
@bleggett bleggett mentioned this pull request Apr 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants