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

aws-autoscaling-common: intervals can never be absolute #30779

Closed
cheruvian opened this issue Jul 8, 2024 · 3 comments
Closed

aws-autoscaling-common: intervals can never be absolute #30779

cheruvian opened this issue Jul 8, 2024 · 3 comments
Assignees
Labels
@aws-cdk/aws-autoscaling-common bug This issue is a bug. closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. p2 response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.

Comments

@cheruvian
Copy link
Contributor

Describe the bug

In this function, absolute changes get changed to all undefined which then breaks the validateAtMostOneUndefined call.

export function normalizeIntervals(intervals: ScalingInterval[], changesAreAbsolute: boolean): CompleteScalingInterval[] {
  // Make intervals a complete numberline
  const full = orderAndCompleteIntervals(intervals);
  // Add 'undefined's in uncovered areas of the number line
  makeGapsUndefined(full);

  // In case of relative changes, treat 0-change also as 'undefined' (= no change action)
  if (!changesAreAbsolute) { makeZerosUndefined(full); }

  // Combine adjacent undefines and make sure there's at most one of them
  combineUndefineds(full);
  validateAtMostOneUndefined(full);

  return full;
}

This means that any step scaling with AdjustmentType.EXACT_CAPACITY and > 2 steps will fail validation

Expected Behavior

Allow this use case.

Current Behavior

Error: Can have at most one no-change interval, got [{"lower":0.99,"upper":1},{"lower":1.99,"upper":2},{"lower":2.99,"upper":3},{"lower":3.99,"upper":4},{"lower":4.99,"upper":5},{"lower":5.99,"upper":6},{"lower":6.99,"upper":7},{"lower":7.99,"upper":8},{"lower":8.99,"upper":9}]

Reproduction Steps

    scalableTaskCount.scaleOnMetric(`TargetScaling`, {
      scalingSteps: [
        { upper: 0.99, change: 0 },
        { lower: 1, upper: 1.99, change: 1 },
        { lower: 2, change: 2 }
      ],
      metric: targetMetric,
      adjustmentType: AdjustmentType.EXACT_CAPACITY,
    });

Possible Solution

No response

Additional Information/Context

No response

CDK CLI Version

latest on gh

Framework Version

No response

Node.js Version

20.14.0

OS

OSX

Language

TypeScript

Language Version

No response

Other information

No response

@cheruvian cheruvian added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Jul 8, 2024
@khushail khushail added needs-reproduction This issue needs reproduction. and removed needs-triage This issue or PR still needs to be triaged. labels Jul 8, 2024
@khushail khushail self-assigned this Jul 8, 2024
@khushail khushail added investigating This issue is being investigated and/or work is in progress to resolve the issue. and removed needs-reproduction This issue needs reproduction. labels Jul 11, 2024
@khushail
Copy link
Contributor

Hey @cheruvian , thanks for reaching out. Could you please share the complete repro code for this issue?

@khushail khushail added response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. and removed investigating This issue is being investigated and/or work is in progress to resolve the issue. labels Jul 12, 2024
Copy link

This issue has not received a response in a while. If you want to keep this issue open, please leave a comment below and auto-close will be canceled.

@github-actions github-actions bot added the closing-soon This issue will automatically close in 4 days unless further comments are made. label Jul 14, 2024
@khushail khushail added the p2 label Jul 16, 2024
@github-actions github-actions bot added closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. and removed closing-soon This issue will automatically close in 4 days unless further comments are made. labels Jul 19, 2024
@aws-cdk-automation
Copy link
Collaborator

Comments on closed issues and PRs are hard for our team to see. If you need help, please open a new issue that references this one.

@aws aws locked as resolved and limited conversation to collaborators Jul 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
@aws-cdk/aws-autoscaling-common bug This issue is a bug. closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. p2 response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.
Projects
None yet
Development

No branches or pull requests

3 participants