-
Notifications
You must be signed in to change notification settings - Fork 522
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(appbuilder): Prevent parallel build processes on the same template #6172
base: master
Are you sure you want to change the base?
Conversation
654bf52
to
3471429
Compare
3471429
to
86848f2
Compare
c46878d
to
0922083
Compare
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.
Left few comments, thanks for implementing these changes!
- updated test with a small delay to avoid possible race condition and test flakiness
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.
Thanks for addressing all the feedback, LGTM
|
||
export async function registerTemplateBuild(templatePath: string) { | ||
const expirationDate = Date.now() + 5 * 60 * 1000 // five minutes | ||
await updateRecentResponse(buildProcessMementoRootKey, globalIdentifier, templatePath, expirationDate.toString()) |
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.
What happens if a build takes longer than 5 minutes? Customer feedback shows that builds can be very, very slow. If the user Cancels the build is that correctly handled?
} | ||
} | ||
|
||
export async function registerTemplateBuild(templatePath: string) { |
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.
"registering" is usually a sign of a design flaw. registries require lifecycle management, and can get "corrupted" by logic bugs (like any "cache" in general).
Is there instead a way we can check SAM CLI's state (e.g. in the .sam-...
directory) to see if it's currently building something? Or a way to run sam ...
and it will tell us if a build is in-progress? Calculating answers (querying) is much more reliable and robust than storing flags and cleaning up state.
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.
We currently can't check sam cli state in the toolkit. I think this is the best we can do right now, until we find a solution in SAM CLI.
2595dbc
to
ea77516
Compare
Context
We currently allow multiple build processes to run at the same time for the same template.
Problem
When running a build, it’s possible to start a second build for the same project. This results in both builds failings
Solution
Prevent parallel builds on the same template
feature/x
branches will not be squash-merged at release time.License: I confirm that my contribution is made under the terms of the Apache 2.0 license.