-
Notifications
You must be signed in to change notification settings - Fork 52
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: Use copy function that does not preserve atime when creating fsaverage directories #703
Conversation
…verage directories
Codecov Report
@@ Coverage Diff @@
## maint/1.3.x #703 +/- ##
============================================
Coverage 48.06% 48.06%
============================================
Files 43 43
Lines 5297 5297
Branches 776 776
============================================
Hits 2546 2546
Misses 2663 2663
Partials 88 88
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
@mgxd Would appreciate a review to make sure I'm not crazy. I intend to do a release cascade so we can be prepared for the next round of fMRIPrep releases. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't seem to matter which copy function is used (at least from local testing on my Macbook), the directory mtime stays the same. In fact, the only timestamp that changes is ctime, and that happens regardless of the copy function.
If sweeps take that into account, we're probably fine - if not, we could just hack the mtime with something like
os.utime(dest, (time.time(), time.time()))
I can reproduce the issue on Linux. Want to try this script? Script:#!/bin/bash
set -eux
mkdir testdir
touch -d "Jan1" testdir/testfile
echo "atime"
ls -luR testdir
echo "mtime"
ls -lR testdir
python <<EOF
import shutil
shutil.copytree("testdir", "testdir.copy2", copy_function=shutil.copy2)
EOF
# Reset atime from copytree
touch -d "Jan1" testdir/testfile
python <<EOF
import shutil
shutil.copytree("testdir", "testdir.copy", copy_function=shutil.copy)
EOF
echo "atime"
ls -lu testdir.copy/testfile
ls -lu testdir.copy2/testfile
echo "mtime"
ls -l testdir.copy/testfile
ls -l testdir.copy2/testfile Result:
|
I think we're looking at this in two different ways. Your tests are comparing the files within I was looking at the top level directory's mtime after using |
The relevant bit is actually the atime more than the mtime. What we think is happening is that the sweeps are seeing files that haven't been accessed in years/months and suddenly they're gone. Being in a more recently accessed or modified directory does not seem to protect them. Hope this is more clear. Can chat tomorrow if we're still not quite connecting. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, then this LGTM
20.2.8 (July 18, 2024) Bug-fix release in the 20.2.x LTS series. We anticipate this being the final release in the 20.2.x LTS series. * FIX: Select volumetric dseg.tsv from recent TemplateFlow releases (#3257) * FIX: LTS package build (#3328) * DOC: Read html_baseurl from RTD environment, if available (#3324) * DOCKER: Pin conda environment more strictly (#2853) * MNT: Require niworkflows ~1.3.6 (#2740) * CI: Upgrade docker orb (#2865) This release includes a number of fixes that have accumulated in niworkflows, including the following fixes that affect fMRIPrep: * FIX: Remove unused ANTs parameter that was removed in 2.4.1 (nipreps/sdcflows#431) * FIX: Limit 3dQwarp to maximum 4 CPUs for stability reasons (nipreps/sdcflows#128) * MAINT: Make call to scipy.stats.mode compatible with scipy 1.11.0 (nipreps/sdcflows#371) * FIX: TSV2JSON should convert empty TSV files to empty JSON files (nipreps/niworkflows#747) * FIX: Use copy function that does not preserve mtime when creating fsaverage directories (nipreps/niworkflows#703) * FIX: Set pixdim[4] to match RepetitionTime (nipreps/niworkflows#679)
Closes #702.