Skip to content

pod.TerminationGracePeriodSeconds setting #15599

Closed as not planned
Closed as not planned

Description

@V2arK

Describe the feature

Right now TerminationGracePeriodSeconds is set to rev.Spec.TimeoutSeconds

https://github.com/knative/serving/blob/main/pkg/reconciler/revision/resources/deploy.go#L304

However, rev.Spec.TimeoutSeconds also specifies the timeout for in-flight request.

I think these two values should be seperated, because in my project, I want to terminate deployment without graceful exit, but I want the timout for in-flight request to be as long as possible.

Activity

  1. added
    kind/featureWell-understood/specified features, ready for coding.
    on Oct 29, 2024
  2. skonto commented on Oct 30, 2024

    @skonto
    Contributor

    I want to terminate deployment without graceful exit, but I want the timout for in-flight request to be as long as possible.

    Hi @V2arK, this was added years ago so there is a guarantee about connections not to be dropped during autoscaling. The knative autoscaler continuously makes decisions about the deployment scale and that may interrupt connections during pod shutdown.
    Could you elaborate on your use case, you don't care about failing requests?

  3. V2arK commented on Oct 31, 2024

    @V2arK
    Author

    Hi @skonto, in my uses cases I just want to terminates the pods ASAP (maybe 3~5 seconds) when I triggers the termination, but not to change the timeout for requests (eg, LLM spits out response in minutes),

  4. skonto commented on Nov 27, 2024

    @skonto
    Contributor

    Hi @V2arK

    when I triggers the termination

    How do you trigger that? You are removing the knative service? Could you just drop the connection when a SIGTERM is received at the LLM python runtime or at the client side too? If you interrupt the connections, draining will happen pretty fast as QP will not wait for them to finish.

  5. V2arK commented on Dec 17, 2024

    @V2arK
    Author

    Hi @skonto ,
    Sorry for the late reply; your message got buried among other communications, and I missed it.

    In our workflow, we use ArgoCD to deploy a serving.knative.dev/v1 Helm chart. When signaling a termination or deletion of a deployment via ArgoCD, we aim to delete the entire deployment quickly. Ideally, we would like Kubernetes to send a SIGKILL directly, (so we can save as much dime as we could :) ) which is controlled by rev.Spec.TimeoutSeconds.

    However, we don't want to change the timeout for in-flight requests; we want it to remain as long as possible.

  6. github-actions commented on Mar 18, 2025

    @github-actions

    This issue is stale because it has been open for 90 days with no
    activity. It will automatically close after 30 more days of
    inactivity. Reopen the issue with /reopen. Mark the issue as
    fresh by adding the comment /remove-lifecycle stale.

  7. added
    lifecycle/staleDenotes an issue or PR has remained open with no activity and has become stale.
    on Mar 18, 2025
  8. dprotaso commented on Apr 18, 2025

    @dprotaso
    Member

    FYI - it's usually the user's app that isn't exiting properly (handling SIGTERM) that's keep the pod alive (and not Knative)

    See: #13600

  9. dprotaso commented on Apr 18, 2025

    @dprotaso
    Member

    This issue does seem related - #15823

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/featureWell-understood/specified features, ready for coding.lifecycle/staleDenotes an issue or PR has remained open with no activity and has become stale.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions