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

S3 upload throws Concurrent read operations are not allowed! when uploading 32mb file #5670

Closed
2 of 14 tasks
tmageebtr opened this issue Nov 12, 2024 · 3 comments
Closed
2 of 14 tasks
Assignees
Labels
bug Something is not working; the issue has reproducible steps and has been reproduced storage Issues related to the Storage Category

Comments

@tmageebtr
Copy link

Description

Using code similar to the S3 upload example, chunked_stream_reader.dart throws 'Concurrent read operations are not allowed!'

This is caused by 2 processes trying to read from the file stream at the same time.

Potential issue identified tracing through s3_upload_task.dart:

_startNextUploadPartsBatch starts up to 4 chunk readers sequentially. Each of these starts a synchronous process to send the chunk to S3. As the uploads finish they trigger another call to _startNextUploadPartsBatch which waits for the first batch to finish. If more than 1 upload process finishes before the first batch finishes we can end up with 2 new _startNextUploadPartsBatch both waiting for the first batch to finish. When that first batch does finish, the 2 new _startNextUploadPartsBatch both start trying to read the file stream resulting in concurrent read attempts.

Categories

  • Analytics
  • API (REST)
  • API (GraphQL)
  • Auth
  • Authenticator
  • DataStore
  • Notifications (Push)
  • Storage

Steps to Reproduce

Using example S3 upload code, upload file greater than 20Mb (4 chunks * 5Mb max chunk)

Screenshots

No response

Platforms

  • iOS
  • Android
  • Web
  • macOS
  • Windows
  • Linux

Flutter Version

3.24.4

Amplify Flutter Version

2.5.0

Deployment Method

Amplify Gen 2

Schema

No response

@github-actions github-actions bot added pending-triage This issue is in the backlog of issues to triage pending-maintainer-response Pending response from a maintainer of this repository labels Nov 12, 2024
@Equartey
Copy link
Contributor

Hi @tmageebtr, thanks for taking the time to open this issue. We will investigate this issue and provide an update when we can.

@Equartey Equartey added the storage Issues related to the Storage Category label Nov 12, 2024
@github-actions github-actions bot removed the pending-maintainer-response Pending response from a maintainer of this repository label Nov 12, 2024
@Equartey Equartey added to-be-reproduced Issues that have not been reproduced yet, but have reproduction steps provided pending-maintainer-response Pending response from a maintainer of this repository and removed pending-maintainer-response Pending response from a maintainer of this repository labels Nov 12, 2024
@tyllark tyllark added bug Something is not working; the issue has reproducible steps and has been reproduced and removed to-be-reproduced Issues that have not been reproduced yet, but have reproduction steps provided labels Nov 19, 2024
@github-actions github-actions bot removed the pending-triage This issue is in the backlog of issues to triage label Nov 19, 2024
@ekjotmultani
Copy link
Member

Hi @tmageebtr, a fix for this has been released in Storage 2.5.1! Thanks again for reporting this issue. Let us know if you have any more questions.

Copy link

This issue is now closed. Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is not working; the issue has reproducible steps and has been reproduced storage Issues related to the Storage Category
Projects
None yet
Development

No branches or pull requests

4 participants