-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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(stepfunctions-tasks): checking for task token in EcsRunTask containerOverrides causes memory explosion #15187
fix(stepfunctions-tasks): checking for task token in EcsRunTask containerOverrides causes memory explosion #15187
Conversation
…ntainerOverrides environment the runTask containerOverrides had references to the entire construct tree causing a large amount of recursion when trying to validate that the task token was provided. the only place for the task token to appear is in the environment of a containerOverride, so only check for it there I also updated the error to mention JsonPath instead of Context since Context is deprecated fixes #15124 in addition to the unit tests, I packaged the library to dotnet and succesfully synthed the reproduction mentioned in #15124 thanks to @BenChaimberg for providing the suggested fix
Do we need to make the same change for run-ecs-task-base.ts? It's marked deprecated, but I believe the same issue exists there. aws-cdk/packages/@aws-cdk/aws-stepfunctions-tasks/lib/ecs/run-ecs-task-base.ts Lines 86 to 89 in b2037d3
|
specifically mention in the error that the task token is expected in the environment property of at least one containerOverride
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.
Thank you so much for your contribution and investigation! Just some small comments.
Do we need to make the same change for run-ecs-task-base.ts? It's marked deprecated, but I believe the same issue exists there.
Yes, please.
packages/@aws-cdk/aws-stepfunctions-tasks/test/ecs/run-tasks.test.ts
Outdated
Show resolved
Hide resolved
packages/@aws-cdk/aws-stepfunctions-tasks/test/ecs/run-tasks.test.ts
Outdated
Show resolved
Hide resolved
packages/@aws-cdk/aws-stepfunctions-tasks/test/ecs/run-tasks.test.ts
Outdated
Show resolved
Hide resolved
packages/@aws-cdk/aws-stepfunctions-tasks/test/ecs/run-tasks.test.ts
Outdated
Show resolved
Hide resolved
packages/@aws-cdk/aws-stepfunctions-tasks/test/ecs/run-tasks.test.ts
Outdated
Show resolved
Hide resolved
rename variable in containerOverride's map arrow function to mbe more clear propagate the same change EcsRunTaskBase since the same defect can occur there add the same tests for EcsrunTaskBase to catch future regression update EcsRunTaskBase task token validation error message to be more accurate and align with the same error throw in runTask
Pull request has been modified.
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
…inerOverrides causes memory explosion (aws#15187) EcsRunTask containerOverrides had references to the entire construct tree causing a large amount of recursion when trying to validate that the task token was provided in the waitForTaskToken integration pattern. The only place for the task token to appear is in the environment of a containerOverride, so we should only check for it there. I also updated the error to mention JsonPath instead of Context since Context is deprecated. In addition to the unit tests, I packaged the library to dotnet and succesfully synthed the minimal reproduction. thanks to @BenChaimberg for providing the suggested fix fixes aws#15124 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
…inerOverrides causes memory explosion (aws#15187) EcsRunTask containerOverrides had references to the entire construct tree causing a large amount of recursion when trying to validate that the task token was provided in the waitForTaskToken integration pattern. The only place for the task token to appear is in the environment of a containerOverride, so we should only check for it there. I also updated the error to mention JsonPath instead of Context since Context is deprecated. In addition to the unit tests, I packaged the library to dotnet and succesfully synthed the minimal reproduction. thanks to @BenChaimberg for providing the suggested fix fixes aws#15124 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
EcsRunTask containerOverrides had references to the entire construct tree causing a large amount of recursion
when trying to validate that the task token was provided in the waitForTaskToken integration pattern. The only place for the task token to appear is in the environment of a containerOverride, so we should only check for it there.
I also updated the error to mention JsonPath instead of Context since Context is deprecated.
In addition to the unit tests, I packaged the library to dotnet and succesfully synthed the minimal reproduction.
thanks to @BenChaimberg for providing the suggested fix
fixes #15124
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license