-
Notifications
You must be signed in to change notification settings - Fork 822
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
fix: back off on cfn event pull #11624
Conversation
@@ -1306,7 +1306,7 @@ commands: | |||
source $BASH_ENV | |||
amplify version | |||
retry runE2eTest | |||
no_output_timeout: 60m | |||
no_output_timeout: 90m |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const self = this; | ||
let delay = CFN_POLL_TIME; | ||
let readStackEventsCalls = 0; | ||
let invoker = function() { | ||
self.addToPollQueue(stackName, 3); | ||
if (delay < CFN_POLL_TIME_MAX) { | ||
delay = Math.min(Math.pow(2, readStackEventsCalls) * CFN_POLL_TIME, CFN_POLL_TIME_MAX); | ||
} | ||
self.pollForEvents = setTimeout(invoker, delay); | ||
readStackEventsCalls++; | ||
} | ||
|
||
// start it off | ||
self.pollForEvents = setTimeout(invoker, delay); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -153,7 +154,20 @@ class CloudFormation { | |||
} | |||
|
|||
readStackEvents(stackName) { | |||
this.pollForEvents = setInterval(() => this.addToPollQueue(stackName, 3), CFN_POLL_TIME); | |||
const self = this; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this rename?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Description of changes
Issue #, if available
Description of how you validated changes
I injected
![image](https://user-images.githubusercontent.com/5849952/208283146-10e754a4-1cc2-4e3e-959d-f1109d4d0c14.png)
console.log('Delay ' + delay + ' Attempt ' + readStackEventsCalls);
intoreadStackEvents
and ran one of the e2e tests. Below is outcome.E2E test run.
https://app.circleci.com/pipelines/github/aws-amplify/amplify-cli/13698/workflows/634b1e55-3c58-49fe-b88e-db161cafb298
Checklist
yarn test
passesBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.