Skip to content

WIP: Follow up to https://github.com/openshift/router/pull/483#515

Closed
frobware wants to merge 8 commits intoopenshift:masterfrom
frobware:OCPBUGS-6958-FixClipTimeout
Closed

WIP: Follow up to https://github.com/openshift/router/pull/483#515
frobware wants to merge 8 commits intoopenshift:masterfrom
frobware:OCPBUGS-6958-FixClipTimeout

Conversation

@frobware
Copy link
Contributor

@frobware frobware commented Oct 2, 2023

  • OCPBUGS-6958: Fix clipHAProxyTimeoutValue so that:
  • add haproxytime
  • use pkg/router/template/util/haproxytime
  • drop existing ParseHAProxyDuration
  • Refactor ParseDuration: MaxTimeout moved to caller, Add boundary tests
  • Update HAProxy timeout validation following ParseDuration changes
  • Add benchmark test to evaluate the performance of ParseDuration
  • haproxytime: change unit tests to encode the expected duration

See #483

candita and others added 8 commits August 22, 2023 21:49
* a value larger than time.ParseDuration can handle is clipped to the HAProxy max timeout
* a value that cannot be properly parsed for other reasons is set to empty instead of being silently allowed

To check that time.ParseDuration is experiencing overflow, add a new ParseHAProxyDuration to the util
package so we can evaluate the errors returned by time.ParseDuration without sacrificing its authority
in parsing time strings.
Modify the function signature of ParseDuration to remove MaxTimeout
checks.

Update comments to reflect that the caller is now responsible for any
MaxTimeout checks.

Add unit tests to exercise the boundary conditions for int64
durations.

Include test cases for small values, large values, and values that
should cause an OverflowError.

Correct erroneous/missing test inputs for microseconds.
Introduced `haproxyMaxTimeout` variable to store parsed max timeout
for HAProxy.

Added an `init()` function that parses
`templateutil.HaproxyMaxTimeout` into `haproxyMaxTimeout` and panics
on invalid duration.

Modified `clipHAProxyTimeoutValue()` to use the newly introduced
`haproxyMaxTimeout` for clipping values that exceed the HAProxy
maximum.

Note: This commit follows a semantic change to
`haproxytime.ParseDuration` (previous commit), which moved the
responsibility for max timeout handling to the caller.
This is largely what I had some commits ago; I experimented with some
changes that required the unit to be discrete in the test case but I
since abandoned that. Encoding expectedDuration arguably makes the
failure cases more obvious as the expectedDuration is simply zero
without needing to specify any units.
@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 2, 2023
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Oct 2, 2023

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Oct 2, 2023

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from frobware. For more information see the Kubernetes Code Review Process.

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

Details 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

@frobware frobware changed the title WIP: Follow up to https://github.com/openshift/cluster-ingress-operator/pull/978 WIP: Follow up to https://github.com/openshift/router/pull/483 Oct 2, 2023
@candita
Copy link
Contributor

candita commented Oct 2, 2023

/test unit

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Oct 2, 2023

@frobware: all tests passed!

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@frobware frobware closed this Oct 5, 2023
@frobware frobware deleted the OCPBUGS-6958-FixClipTimeout branch May 1, 2024 12:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants