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 timeout problem on client for large chunked uploads. #92

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

blattms
Copy link

@blattms blattms commented Apr 20, 2023

Putting those chunks together and moving the file to temporary storage might take quite some time. Hence the response to the upload of the last chunk might take longer than the timeout on the client.

In that case the client will retry uploading the last chunk and this would fail on the server with the following log message, because the upload is already complete (offset is the size of the uploaded file:

ERROR django_drf_filepond: uploaders Offset provided by client <22807552000> doesn't match the stored offset <22808122462> for chunked upload id ...

This change will do two things for the reupload attempts of the client:

  1. If the upload is already complete but the chunks are not yet put together then it will sleep a while and return HTTP error code 408
  2. If the upload was already put together successfully, then it will return success.

Putting those chunks together and moving the file to temporary
storage might take quite some time. Hence the response to the upload
of the last chunk might take longer than the timeout on the client.

In that case the client will retry uploading the last chunk and this
would fail on the server with the following log message, because the
upload is already complete (offset is the size of the uploaded file:
```
ERROR django_drf_filepond: uploaders Offset provided by client <22807552000> doesn't match the stored offset <22808122462> for chunked upload id ...
```

This change will do two things for the reupload attempts of the client:
1. If the upload is already complete but the chunks are not yet put
   together then it will sleep a while and return HTTP error code 408
2. If the upload was already put together successfully, then it will
   return success.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant