add: do not verify hardlink if file is empty#3428
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3428 +/- ##
=======================================
Coverage 93.08% 93.08%
=======================================
Files 140 140
Lines 8515 8515
=======================================
Hits 7926 7926
Misses 589 589 Continue to review full report at Codecov.
|
There was a problem hiding this comment.
What do you think to fix the issue another way:
- in
_verify_linkcheck the case when the file is not a link and has size0 bytes - if it's True - just don't raise an Exception
- put the comment with the issue and short description about the case
It allows to fix it in one place without passing inconsistent return value
UPD
I see @pared propsed the same in the comment above
|
We (@efiop and I) discussed this on 1o1. A better way to fix this would be to try to create a temporary file to check if the System supports |
| if link_type == "hardlink" and self.getsize(path_info) == 0: | ||
| return | ||
|
|
There was a problem hiding this comment.
Not great that it will be checking the size for each link it creates, might get expensive. Though, it does that in hardlink anyway...
There was a problem hiding this comment.
We did that anyway on the hardlink() though.
There was a problem hiding this comment.
@skshetry Maybe there is some nicer way to do this? Like making hardlink(and other link class methods) verify themselves? This is an honest question, I don't know myself either 🙂
There was a problem hiding this comment.
@skshetry Could keep it as is and create a ticket for it to reconsider later. Just asking.
There was a problem hiding this comment.
I like this suggestion #3428 (comment) more. Running verification on hardlink itself for only once (by setting self.cache_type_confirmed) is also hackish.
I'd say, we revisit this on next sprint and fix it?
There was a problem hiding this comment.
@skshetry Ok, please create an issue and add it to the next sprint.
There was a problem hiding this comment.
We could just check for cache_type_verified at the beggining again. I know that is duplication, but don't see any obvious workaround.
|
@skshetry Check your tests, travis failed. |
pared
left a comment
There was a problem hiding this comment.
So, the conclusion for this issue is that we will crete issue to fix the way we handle confirmation of cache type?
|
@skshetry Please check the tests. |
Fixes #3390
❗ Have you followed the guidelines in the Contributing to DVC list?
📖 Check this box if this PR does not require documentation updates, or if it does and you have created a separate PR in dvc.org with such updates (or at least opened an issue about it in that repo). Please link below to your PR (or issue) in the dvc.org repo.
❌ Have you checked DeepSource, CodeClimate, and other sanity checks below? We consider their findings recommendatory and don't expect everything to be addressed. Please review them carefully and fix those that actually improve code or fix bugs.
Thank you for the contribution - we'll try to review it as soon as possible. 🙏