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

Add timeout handler to activator to respect the revision timeouts #13261

Merged
merged 2 commits into from
Aug 31, 2022

Conversation

nader-ziada
Copy link
Member

Fixes #12728

Proposed Changes

  • Add timeout handler to activator to respect the revision timeouts

Release Note

Add timeout handling in Activator  when processing a request for a revision

@knative-prow knative-prow bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. area/API API objects and controllers area/autoscale area/networking labels Aug 30, 2022
@codecov
Copy link

codecov bot commented Aug 30, 2022

Codecov Report

Merging #13261 (1345cbb) into main (f517a90) will decrease coverage by 0.08%.
The diff coverage is 25.00%.

@@            Coverage Diff             @@
##             main   #13261      +/-   ##
==========================================
- Coverage   86.58%   86.49%   -0.09%     
==========================================
  Files         196      196              
  Lines       14511    14526      +15     
==========================================
  Hits        12564    12564              
- Misses       1648     1663      +15     
  Partials      299      299              
Impacted Files Coverage Δ
cmd/activator/main.go 0.00% <0.00%> (ø)
pkg/queue/sharedmain/main.go 0.61% <0.00%> (-0.01%) ⬇️
pkg/http/handler/timeout.go 84.76% <61.53%> (+1.32%) ⬆️
pkg/autoscaler/statserver/server.go 77.77% <0.00%> (-1.49%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@nader-ziada nader-ziada changed the title [WIP] Add timeout handler to activator to respect the revision timeouts Add timeout handler to activator to respect the revision timeouts Aug 31, 2022
@knative-prow knative-prow bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 31, 2022
@nader-ziada
Copy link
Member Author

@psschwei can you take a look when you get a chance?

Comment on lines 37 to 39
timeout time.Duration
responseStartTimeout time.Duration
idleTimeout time.Duration
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we still need these in the struct, or could we get by with local variables in the ServeHTTP method?

Copy link
Contributor

Choose a reason for hiding this comment

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

Or alternatively, could we do the timeoutFunc logic in the activator main body (similar to how it's done for QP) and leave the struct unchanged?

Copy link
Member Author

Choose a reason for hiding this comment

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

I believe the activator doesn't have the same env variables for the Revision, so its need to get it from the request and that's why I did the func , but removing the struct makes sense

Copy link
Contributor

@psschwei psschwei left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

@knative-prow knative-prow bot added the lgtm Indicates that a PR is ready to be merged. label Aug 31, 2022
@knative-prow
Copy link

knative-prow bot commented Aug 31, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: nader-ziada, psschwei

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@knative-prow knative-prow bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 31, 2022
@knative-prow knative-prow bot merged commit 4fc7743 into knative:main Aug 31, 2022
nak3 pushed a commit to nak3/serving that referenced this pull request Dec 22, 2022
…ative#13261)

* add timeout handler to activator

* remove unnecessary fields from timeout struct
openshift-merge-robot pushed a commit to openshift-knative/serving that referenced this pull request Dec 22, 2022
…ative#13261) (#97)

* add timeout handler to activator

* remove unnecessary fields from timeout struct

Co-authored-by: Nader Ziada <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/API API objects and controllers area/autoscale area/networking lgtm Indicates that a PR is ready to be merged. 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.

Activator Timeout
2 participants