Capture ResourcePath transfer_from exception in copy_files_for_distribution#108
Capture ResourcePath transfer_from exception in copy_files_for_distribution#108zhaoyuyoung wants to merge 1 commit into
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #108 +/- ##
==========================================
+ Coverage 34.88% 36.77% +1.89%
==========================================
Files 13 13
Lines 1313 1327 +14
Branches 214 215 +1
==========================================
+ Hits 458 488 +30
+ Misses 835 817 -18
- Partials 20 22 +2 ☔ View full report in Codecov by Sentry. |
| future_file_copy = {} | ||
| for src, trgt in files_to_copy.items(): | ||
| _LOG.debug("Staging %s to %s", src, trgt) | ||
| future = copy_executor.submit(trgt.transfer_from, src, transfer="copy") |
There was a problem hiding this comment.
I think this code is more complicated than it needs to be. If trgt and src are ResourcePath objects then ResourcePath.mtransfer can do all of this itself so you can delete most of this code.
There was a problem hiding this comment.
I'll check ResourcePath.mtransfer. This is a piece of legacy codes that started with IDF, so I guess it exists for a reason.
At the same time, I've found the reason why w_2026_12 failed to copy the quantum graph with the wrong protocol http:/ at RAL. It turns out the uri is treated as a local file other than the WebDAV one. So it's not a silent failure, but a successful transfer_from to the wrong destination.
There was a problem hiding this comment.
It existed before ResourcePath.mtransfer was written and which does exactly what this legacy code does.
There was a problem hiding this comment.
Thanks for showing me this very useful tool. I've changed to use ResourcePath.mtransfer and the exception it catches. Will ask for a review next week.
fa3dec9 to
9b46ccd
Compare
9b46ccd to
3e517ff
Compare
Checklist
doc/changes