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

fix(filemanager): add uuid to target directory to avoid concurrency errors #189

Merged
merged 1 commit into from
Mar 28, 2024

Conversation

mmalenic
Copy link
Member

@mmalenic mmalenic commented Mar 28, 2024

Related to #169 and associated PRs.

100% this should work now.

Changes

  • Add random uuid to target directory to prevent parallel execution of tests from interfering with another test's compiled outputs.
  • Bump deps.

Thanks for the codebuild-breakpoint tip @victorskl, it helped a lot to find the issue.

@mmalenic mmalenic self-assigned this Mar 28, 2024
@mmalenic mmalenic requested a review from victorskl March 28, 2024 04:18
@mmalenic mmalenic added fix filemanager an issue relating to the filemanager labels Mar 28, 2024
@mmalenic mmalenic requested a review from brainstorm March 28, 2024 04:27
@mmalenic
Copy link
Member Author

A bit more context for this:

The issue was that because the cdk-nag tests run in parallel and the stacks are synthesized multiple times, another test would steal the compiled output from cargo lambda in the same target directory because it was expecting the exact same asset as all the other tests. This would result in a warning from cargo lambda:

WARN run: no binaries found in target directory after build, try using the --bin, --example, or --package options to build specific binaries

and subsequently cause the bundling to fail because aws-cdk-lib is unable to find any assets to bundle:

Bundling did not produce any output. Check that content is written to /tmp/cdk.outv5RzsD/bundling-temp-b3b38d7e2dc2fa1a2772516915a13b2482d6426c85b9386f68061db610f0b781

To fix this, the change was requiring that each invocation of RustFunction would compile output to a unique location. Note, that dependency compilation is in a shared cache so it's not that all code is recompiled for each test, just the final binary.

Interestingly, I wasn't able to trigger this very easily locally (although I did a few times), and it tended to only happen in CodeBuild.

Related #190.

Copy link
Member

@victorskl victorskl left a comment

Choose a reason for hiding this comment

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

Great detective work!

@mmalenic mmalenic merged commit f191258 into main Mar 28, 2024
2 checks passed
@mmalenic mmalenic deleted the fix/docker-container-name branch March 28, 2024 06:04
@victorskl victorskl linked an issue Mar 28, 2024 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
filemanager an issue relating to the filemanager fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

filemanager: reconfigure deployment to match other microservices
2 participants