-
Notifications
You must be signed in to change notification settings - Fork 18
Fixed race condition when a copy is performed #703
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
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
✅ All tests successful. No failed tests found. Additional details and impacted files@@ Coverage Diff @@
## master #703 +/- ##
==========================================
+ Coverage 72.15% 72.22% +0.06%
==========================================
Files 89 89
Lines 11778 11812 +34
Branches 2074 2079 +5
==========================================
+ Hits 8499 8531 +32
- Misses 2797 2798 +1
- Partials 482 483 +1 ☔ View full report in Codecov by Sentry. |
1cf7405 to
026b741
Compare
The same problem was resolved in #328. This issue reappeared after the introduction of the `StreamFlowPath` class. When a file transfer is needed, before it is necessary to wait for the source data location to become available. With the introduction of the `StreamFlowPath` class, this wait was moved inside the `resolve` method. However, only the `RemoteStreamFlowPath` was performing the wait. Now, the `resolve` method of the `LocalStreamFlowPath` also performs the wait before resolving the path.
026b741 to
69b4711
Compare
|
edit. resolved and implemented |
0736902 to
8ced47d
Compare
8ced47d to
8b09893
Compare
b21f362 to
e7820f1
Compare
256e723 to
b30eaba
Compare
8c05dac to
4a6edc9
Compare
This commit fixes a race condition in data transfers and fixes the duplication of the same output multiple times.
This error occurs when it is necessary to get a unique output path. If this method raises the
FilExistsError,it does not wait for the data location of the source as happens in thetransfer_datamethod. Thus, the data could not exist when thechecksummethod is performed.A similar issue was fixed in the #328. It reappeared after the introduction of the
StreamFlowPathclass. Before starting a data transfer, it is necessary to wait for the source data location that becomes available. When theStreamFlowPathclass was introduced, this wait was moved inside theresolvemethod. However, only theRemoteStreamFlowPathperformed the wait.Now, the
resolvemethod of theLocalStreamFlowPathalso performs the wait before resolving the path, and the same optimization of theresolvemethod of theRemoteStreamFlowPathis done. If the path is already present in theDataManagerand isPRIMARY, it is returned directly.Moreover, this commit introduces a fix for future similar errors. Many
StreamFlowPathmethods, including thechecksum, check if the file is available in theDataLocation. An attribute that stores this information was added to reduce the need to query theDataManagereach time.This race condition issue has another problem. We said that before computing the operation on the path, we must wait for the
DataLocationto become available. However, having as outputs the same file twice, it is possible to have the following case: the two tasks perform theget_unique_output_path, the first registers the path in the workflow dictionary, and the second will raise theFileExistsError. After that, the second should wait for the first to complete, but maybe the first did not create theDataLocationyet. Before this commit, the second continued the execution, raising errors.