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

Respect revision timeout defaults in cm #14600

Merged
merged 1 commit into from
Nov 22, 2023

Conversation

skonto
Copy link
Contributor

@skonto skonto commented Nov 7, 2023

Proposed Changes

  • See discussion here: https://cloud-native.slack.com/archives/C04LMU0AX60/p1690977838372249.
  • If global defaults for revision-idle-timeout-seconds & revision-response-start-timeout-seconds are set to a positive value less than the revision timeout we need to respect that and set some timer.
  • We avoid creating timers we don't need, as previously.
    /kind bug

Release Note

 If global defaults for `revision-idle-timeout-seconds` & `revision-response-start-timeout-seconds` are now applied when creating a Revision.

@knative-prow knative-prow bot added kind/bug Categorizes issue or PR as related to a bug. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. labels Nov 7, 2023
@knative-prow knative-prow bot added area/API API objects and controllers size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Nov 7, 2023
// Default ResponseStartTimeoutSeconds only in case we have a non-zero default and the latter is not larger than the revision timeout.
// A zero default or a zero value set from the user or a nil value skips timer setup at the QP side.
if rs.ResponseStartTimeoutSeconds == nil {
if cfg.Defaults.RevisionRequestStartTimeoutSeconds < *rs.TimeoutSeconds && cfg.Defaults.RevisionRequestStartTimeoutSeconds != 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.

revision-response-start-timeout-seconds is used to initialize RevisionRequestStartTimeoutSeconds so we use that.

	// We default this to what the user has specified
	nc.RevisionRequestStartTimeoutSeconds = nc.RevisionTimeoutSeconds

	if err := cm.Parse(data,
		cm.AsInt64("revision-response-start-timeout-seconds", &nc.RevisionRequestStartTimeoutSeconds),
	); err != nil {
		return nil, err
	}

Copy link
Member

Choose a reason for hiding this comment

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

Can we update RevisionRequestStartTimeoutSeconds to match the key name in a subsequent PR?

Copy link

codecov bot commented Nov 7, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (f3e1a2d) 86.03% compared to head (92f4aef) 86.01%.
Report is 31 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #14600      +/-   ##
==========================================
- Coverage   86.03%   86.01%   -0.02%     
==========================================
  Files         197      197              
  Lines       14916    14924       +8     
==========================================
+ Hits        12833    12837       +4     
- Misses       1774     1778       +4     
  Partials      309      309              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@skonto skonto requested a review from ReToCode November 7, 2023 14:33
@skonto
Copy link
Contributor Author

skonto commented Nov 7, 2023

/test upgrade-tests

@skonto skonto changed the title [wip] Respect revision timeout defaults in cm Respect revision timeout defaults in cm Nov 7, 2023
@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 Nov 7, 2023
Copy link
Member

@dprotaso dprotaso left a comment

Choose a reason for hiding this comment

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

/lgtm

// Default ResponseStartTimeoutSeconds only in case we have a non-zero default and the latter is not larger than the revision timeout.
// A zero default or a zero value set from the user or a nil value skips timer setup at the QP side.
if rs.ResponseStartTimeoutSeconds == nil {
if cfg.Defaults.RevisionRequestStartTimeoutSeconds < *rs.TimeoutSeconds && cfg.Defaults.RevisionRequestStartTimeoutSeconds != 0 {
Copy link
Member

Choose a reason for hiding this comment

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

Can we update RevisionRequestStartTimeoutSeconds to match the key name in a subsequent PR?

@knative-prow knative-prow bot added the lgtm Indicates that a PR is ready to be merged. label Nov 22, 2023
Copy link

knative-prow bot commented Nov 22, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dprotaso, skonto

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 Nov 22, 2023
@dprotaso
Copy link
Member

Can you update the PR body with a release-note

@knative-prow knative-prow bot merged commit 32f2ba2 into knative:main Nov 22, 2023
79 checks passed
@jgournet
Copy link

@skonto :
sorry, I'm a bit late on this one, but:
would it be possible to update the documentation https://knative.dev/docs/serving/configuration/config-defaults/#revision-cpu-request with those new timeouts ?

@skonto
Copy link
Contributor Author

skonto commented Apr 9, 2024

@jgournet sorry for the late reply, sure.

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 kind/bug Categorizes issue or PR as related to a bug. 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.

None yet

3 participants