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 possible double writing of the uploaded client files in Upload-Multiple requests #6952

Merged
merged 8 commits into from
Oct 17, 2023

Conversation

zhiltsov-max
Copy link
Contributor

@zhiltsov-max zhiltsov-max commented Oct 6, 2023

Fixes #6878

In the case of big files (>2.5 MB by default), the uploaded files could be write-appended twice,
leading to bigger raw file sizes than expected. This PR fixes the behavior by excluding repetitive
writes where it was not supposed.

  • Fixed double append-writing of the uploaded files when Upload-Multiple requests are used
  • Fixed potential DB - disk inconsistencies in the case of upload errors
  • Added tests

Motivation and context

How has this been tested?

Checklist

  • I submit my changes into the develop branch
  • I have created a changelog fragment
  • I have updated the documentation accordingly
  • I have added tests to cover my changes
  • I have linked related issues (see GitHub docs)
  • I have increased versions of npm packages if it is necessary
    (cvat-canvas,
    cvat-core,
    cvat-data and
    cvat-ui)

License

  • I submit my code changes under the same MIT License that covers the project.
    Feel free to contact the maintainers if that's a concern.

@zhiltsov-max zhiltsov-max changed the title Fix possible double writing of the uploaded client files in Upload-Multiple requests [WIP] Fix possible double writing of the uploaded client files in Upload-Multiple requests Oct 6, 2023
@zhiltsov-max zhiltsov-max changed the title [WIP] Fix possible double writing of the uploaded client files in Upload-Multiple requests Fix possible double writing of the uploaded client files in Upload-Multiple requests Oct 9, 2023
@codecov
Copy link

codecov bot commented Oct 12, 2023

Codecov Report

Merging #6952 (77edafe) into develop (b450b44) will decrease coverage by 0.26%.
Report is 23 commits behind head on develop.
The diff coverage is 100.00%.

@@             Coverage Diff             @@
##           develop    #6952      +/-   ##
===========================================
- Coverage    82.59%   82.34%   -0.26%     
===========================================
  Files          360      361       +1     
  Lines        38926    39169     +243     
  Branches      3570     3586      +16     
===========================================
+ Hits         32150    32252     +102     
- Misses        6776     6917     +141     
Components Coverage Δ
cvat-ui 77.31% <100.00%> (-0.30%) ⬇️
cvat-server 86.96% <100.00%> (-0.21%) ⬇️

@jcorrochanoj
Copy link

Would it be possible to have this fix in the next release? Thank you very much!

task_id, _ = create_task(self._USERNAME, task_spec, task_data)

# check that the original chunk image have the original size
# this is less accurate than checking the uploaded file directly, but faster
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you clarify why this is less accurate?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because we're not checking the original problem exactly, as it was with raw uploaded files. The chunks may get processed data, which can be correct for some foreign reasons, which can shadow the initial problem.

Co-authored-by: Roman Donchenko <roman@cvat.ai>
@SpecLad SpecLad merged commit e8db2c3 into develop Oct 17, 2023
33 checks passed
@SpecLad SpecLad deleted the zm/fix-6878 branch October 17, 2023 09:13
@cvat-bot cvat-bot bot mentioned this pull request Oct 23, 2023
mikhail-treskin pushed a commit to retailnext/cvat that referenced this pull request Oct 25, 2023
…ltiple requests (cvat-ai#6952)

Fixes cvat-ai#6878 

In the case of big files (>2.5 MB by default), the uploaded files could
be write-appended twice,
leading to bigger raw file sizes than expected. This PR fixes the
behavior by excluding repetitive
writes where it was not supposed.

- Fixed double append-writing of the uploaded files when Upload-Multiple
  requests are used
- Fixed potential DB - disk inconsistencies in the case of upload errors
- Added tests
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.

Images uploaded via the SDK are twice as large as those uploaded via the web interface
3 participants