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: Minimize scope for directory changes while loading results file #3061

Merged
merged 3 commits into from
Oct 3, 2019

Conversation

effigies
Copy link
Member

@effigies effigies commented Oct 2, 2019

Summary

This PR attempts to handle the results file failures by separating concerns.

  1. Load the results file without changing directories. We are pretty consistently seeing "No file named results_<whatever>.pklz, which at the minimum is uninformative. There's no reason not to know the full path of the file when we try to open it.

  2. Perform pickle.loads on the file contents as a single-line with indirectory context block.

  3. All other operations are directory independent and file-lock independent.

Alternative to #3047.

Sorry to preempt that process, but we're seeing this a lot, and I don't really know how to help move that one along. I'm going to use this branch to see if we can resolve these issues that are popping up a lot in the fMRIPrep tests.

Acknowledgment

  • (Mandatory) I acknowledge that this contribution will be available under the Apache 2 license.

Copy link
Contributor

@oesteban oesteban left a comment

Choose a reason for hiding this comment

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

This is a great idea to approach the problem. By splitting the lock and the change of directories we are preempting their conflict.

nipype/utils/filemanip.py Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Oct 2, 2019

Codecov Report

Merging #3061 into master will decrease coverage by 0.02%.
The diff coverage is 80%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3061      +/-   ##
==========================================
- Coverage   67.72%   67.69%   -0.03%     
==========================================
  Files         344      344              
  Lines       44087    44091       +4     
  Branches     5554     5555       +1     
==========================================
- Hits        29856    29846      -10     
- Misses      13465    13478      +13     
- Partials      766      767       +1
Flag Coverage Δ
#smoketests 50.29% <48%> (-0.01%) ⬇️
#unittests 65.15% <80%> (-0.03%) ⬇️
Impacted Files Coverage Δ
nipype/utils/filemanip.py 80.31% <80%> (-0.05%) ⬇️
nipype/interfaces/dcm2nii.py 59.06% <0%> (-6.05%) ⬇️

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 085767c...39806c6. Read the comment docs.

@effigies
Copy link
Member Author

effigies commented Oct 2, 2019

dcm2niix bug cropping up again. Merging master. Please see nipreps/fmriprep#1800 and nipreps/fmriprep#1803 for fixed tests.

@effigies effigies merged commit 5405950 into nipy:master Oct 3, 2019
@effigies effigies deleted the fix/results_file branch October 3, 2019 03:43
@effigies effigies added this to the 1.3.0 milestone Oct 3, 2019
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.

None yet

3 participants