uber / kraken

P2P Docker registry capable of distributing TBs of data in seconds
Apache License 2.0
6.14k stars 423 forks source link

Always delete upload file after MoveUploadFileToCache #274

Closed evelynl94 closed 4 years ago

evelynl94 commented 4 years ago

An upload files is a temp file with a random uuid name. The uuid name is discarded after the file is committed to the file store and should not be reused. When MoveUploadFileToCache fails, it indicates that there is a problem reading/streaming the file or the content is corrupted. We should delete the upload file regardless to avoid failed uploads accumulating on disk.

codecov[bot] commented 4 years ago

Codecov Report

Merging #274 into master will increase coverage by 0.12%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #274      +/-   ##
==========================================
+ Coverage   66.34%   66.47%   +0.12%     
==========================================
  Files         186      186              
  Lines        9224     9220       -4     
==========================================
+ Hits         6120     6129       +9     
+ Misses       2340     2333       -7     
+ Partials      764      758       -6     
Impacted Files Coverage Δ
lib/store/ca_store.go 62.79% <100.00%> (+7.23%) :arrow_up:
lib/torrent/scheduler/events.go 72.59% <0.00%> (+1.44%) :arrow_up:
utils/dedup/interval_trap.go 100.00% <0.00%> (+10.00%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 631e4d1...685085a. Read the comment docs.