Skip to content

fix(ec2): instance resourceSignalTimeout overwrites initOptions.timeout#31446

Merged
mergify[bot] merged 20 commits intoaws:mainfrom
michelle-wangg:overwriting-timeout
Sep 24, 2024
Merged

fix(ec2): instance resourceSignalTimeout overwrites initOptions.timeout#31446
mergify[bot] merged 20 commits intoaws:mainfrom
michelle-wangg:overwriting-timeout

Conversation

@michelle-wangg
Copy link
Copy Markdown
Contributor

@michelle-wangg michelle-wangg commented Sep 13, 2024

Issue # (if applicable)

Closes #30052

Reason for this change

When specifiying both resourceSignalTimeout and initOptions.timeout in the options for creating an EC2 Instance, only the value from resourceSignalTimeout is used.

Description of changes

  • If both initOptions.timeout and resourceSignalTimeout are set, timeout consisting of the sum of the values and a warning suggesting that only one field should be specified
  • Else, timeout is set to field specified, else defaults to 5 min

Description of how you validated changes

  • Update integration test for instance-init.js with both fields and verify that warning is logged
  • Add unit tests:
    • initOptions.timeout and resourceSignalTimeout are both not set, timeout is set to default of 5 min
    • initOptions.timeout set and resourceSignalTimeout not set, timeout is set to initOptions.timeout
    • initOptions.timeout not set and resourceSignalTimeout is set, timeout is set to resourceSignalTimeout
    • initOptions.timeout and resourceSignalTimeout are both set, timeout is set to sum of timeouts and warning is logged

Checklist


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@aws-cdk-automation aws-cdk-automation requested a review from a team September 13, 2024 22:11
@github-actions github-actions bot added the p2 label Sep 13, 2024
@mergify mergify bot added the contribution/core This is a PR that came from AWS. label Sep 13, 2024
@github-actions github-actions bot added bug This issue is a bug. effort/small Small work item – less than a day of effort labels Sep 13, 2024
Copy link
Copy Markdown
Collaborator

@aws-cdk-automation aws-cdk-automation left a comment

Choose a reason for hiding this comment

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

The pull request linter has failed. See the aws-cdk-automation comment below for failure reasons. If you believe this pull request should receive an exemption, please comment and provide a justification.

A comment requesting an exemption should contain the text Exemption Request. Additionally, if clarification is needed add Clarification Request to a comment.

@michelle-wangg michelle-wangg changed the title fix(ec2): Instance resourceSignalTimeout overwrites initOptions.timeout fix(ec2): instance resourceSignalTimeout overwrites initOptions.timeout Sep 16, 2024
@aws-cdk-automation aws-cdk-automation dismissed their stale review September 16, 2024 17:14

✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.

@michelle-wangg michelle-wangg marked this pull request as ready for review September 16, 2024 21:03
@aws-cdk-automation aws-cdk-automation added the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Sep 16, 2024
Copy link
Copy Markdown
Member

@GavinZZ GavinZZ left a comment

Choose a reason for hiding this comment

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

Nice Michelle! Left some comments.

I see your fix would now be summing the two values up. This would mean that users (who haven't changed their template) would have the values updated in their next deployment if they upgrade their CDK version. This is generally a sign of breaking change, however, in this case it's extending the timeout value. I think this can be argued to be a non-breaking change. Can you include @moelasmar in the review and get his though?

@aws-cdk-automation aws-cdk-automation removed the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Sep 16, 2024
@michelle-wangg michelle-wangg force-pushed the overwriting-timeout branch 2 times, most recently from 563f7fe to 40dbdd2 Compare September 19, 2024 22:03
Copy link
Copy Markdown
Contributor

@moelasmar moelasmar left a comment

Choose a reason for hiding this comment

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

left minor comments, and you need to rerun the integration test cases with --update-on-failed flag

@aws-cdk-automation
Copy link
Copy Markdown
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: dab5af4
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@GavinZZ
Copy link
Copy Markdown
Member

GavinZZ commented Sep 23, 2024

@mergify update

@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Sep 23, 2024

update

☑️ Nothing to do

Details
  • #commits-behind > 0 [📌 update requirement]
  • -closed [📌 update requirement]
  • -conflict [📌 update requirement]
  • queue-position = -1 [📌 update requirement]

@GavinZZ GavinZZ dismissed moelasmar’s stale review September 24, 2024 00:13

Dismissing Mohamed's review since it's all addressed.

@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Sep 24, 2024

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@mergify mergify bot merged commit a29bf19 into aws:main Sep 24, 2024
@github-actions
Copy link
Copy Markdown
Contributor

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

bug This issue is a bug. contribution/core This is a PR that came from AWS. effort/small Small work item – less than a day of effort p2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

(aws-ec2): Instance resourceSignalTimeout overwrites initOptions.timeout

5 participants