Thanks to visit codestin.com
Credit goes to github.com

Skip to content

harden s3 v3 concurrency #9517

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

Merged
merged 4 commits into from
Oct 31, 2023
Merged

harden s3 v3 concurrency #9517

merged 4 commits into from
Oct 31, 2023

Conversation

bentsku
Copy link
Contributor

@bentsku bentsku commented Oct 31, 2023

Motivation

Following a failure when trying to set the v3 provider as default, I had this PR shelved since a while as I was expecting it to happen.
https://app.circleci.com/pipelines/github/localstack/localstack/19625/workflows/c064060a-3962-4b34-96a0-6c0bfe0efc00/jobs/153568/tests

This PR hardens S3 v3 concurrency, by shallow copying dict that will be accessed concurrently before calling .values, .keys or .items on them, which could trigger exception as they would be modified during iteration.

\cc @dfangl since we worked on this together for the v2 provider

Changes

Shallow-copy some dictionaries so that they wouldn't be modified during iteration from concurrent requests.
Also added a test to check for iteration during List* calls.

@bentsku bentsku requested a review from macnev2013 as a code owner October 31, 2023 14:38
@bentsku bentsku self-assigned this Oct 31, 2023
@bentsku bentsku added aws:s3 Amazon Simple Storage Service semver: patch Non-breaking changes which can be included in patch releases labels Oct 31, 2023
@bentsku bentsku requested a review from alexrashed October 31, 2023 14:39
@coveralls
Copy link

coveralls commented Oct 31, 2023

Coverage Status

coverage: 82.493% (+0.02%) from 82.478% when pulling 2f95962 on harden-s3-v3-concurrency into d97a2e8 on master.

Copy link
Member

@alexrashed alexrashed left a comment

Choose a reason for hiding this comment

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

Thanks for proactively tackling this issue! πŸš€
For some context: This is the change from @dfangl which implemented the same measures to harden the bucket creation - #9072.

Copy link

LocalStack Community integration with Pro

βŸβ€„β€ˆβŸβ€„βŸβ€„2 filesβ€„β€ƒβŸβ€„β€ˆβŸβ€„βŸβ€„2 suites   1h 10m 9s ⏱️
2β€ˆ317 tests 1β€ˆ744 βœ”οΈβ€ƒ573 πŸ’€β€ƒ0 ❌
2β€ˆ318 runs  1β€ˆ744 βœ”οΈβ€ƒ574 πŸ’€β€ƒ0 ❌

Results for commit 2f95962.

@bentsku bentsku merged commit f68f8b3 into master Oct 31, 2023
@bentsku bentsku deleted the harden-s3-v3-concurrency branch October 31, 2023 17:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
aws:s3 Amazon Simple Storage Service semver: patch Non-breaking changes which can be included in patch releases
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants