Page MenuHomeSoftware Heritage

FUSE: fs: history/by-date: update .status count on read
ClosedPublic

Authored by haltode on Dec 18 2020, 9:56 AM.

Diff Detail

Repository
rDFUSE FUSE virtual file system
Branch
feature/update-status-on-read
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 18012
Build 27822: Phabricator diff pipeline on jenkinsJenkins console · Jenkins
Build 27821: arc lint + arc unit

Event Timeline

Build is green

Patch application report for D4763 (id=16860)

Rebasing onto a6cef6bad5...

Current branch diff-target is up to date.
Changes applied before test
commit f006ab1255f7b048dd6c0db3a96d0061dd60e2e1
Author: Thibault Allançon <haltode@gmail.com>
Date:   Fri Dec 18 09:52:24 2020 +0100

    fs: history/by-date: update .status count on read

See https://jenkins.softwareheritage.org/job/DFUSE/job/tests-on-diff/241/ for more details.

LGTM in general, I've just nitpicked about a couple of things.

Also: would it be feasible to have a test for this? It would be nice to have, because it is a tricky behavior that I can easily see going wrong in the future if we do other changes. (But yes, testing stateful things could be annoying…)

swh/fuse/fs/artifact.py
276

I don't like that you are setting file_info_attrs, potentially overwriting everything that was in there.
You should selectively set/unset what you need. I guess in this case this would mean setting direct_io and clearing keep_cache, but I'll let you verify if that's true.

283

will this ever be shown?
IIRC the idea was to remove from the dir listing the .status file when done, because that makes it easy to programmatically check if population is completed or not

swh/fuse/fs/entry.py
53

As per previous comment: do not set the dict, just override what you need.
Doing so will play nicer with mixins, inheritance, etc.

zack requested changes to this revision.Dec 18 2020, 10:04 AM
This revision now requires changes to proceed.Dec 18 2020, 10:04 AM

Override instead of setting dict

Build is green

Patch application report for D4763 (id=16861)

Rebasing onto a6cef6bad5...

Current branch diff-target is up to date.
Changes applied before test
commit d5cd9667c7f8a95a4cb45f565ec900079850af52
Author: Thibault Allançon <haltode@gmail.com>
Date:   Fri Dec 18 09:52:24 2020 +0100

    fs: history/by-date: update .status count on read

See https://jenkins.softwareheritage.org/job/DFUSE/job/tests-on-diff/242/ for more details.

  • fs: history/by-date: invalidate .status inode when done

Build is green

Patch application report for D4763 (id=16877)

Rebasing onto a6cef6bad5...

Current branch diff-target is up to date.
Changes applied before test
commit 87e1e1868e5a84ac064dfb418f0e37ca0b0c46cd
Author: Thibault Allançon <haltode@gmail.com>
Date:   Fri Dec 18 15:47:12 2020 +0100

    fs: history/by-date: invalidate .status inode when done

commit d5cd9667c7f8a95a4cb45f565ec900079850af52
Author: Thibault Allançon <haltode@gmail.com>
Date:   Fri Dec 18 09:52:24 2020 +0100

    fs: history/by-date: update .status count on read

See https://jenkins.softwareheritage.org/job/DFUSE/job/tests-on-diff/243/ for more details.

This revision is now accepted and ready to land.Dec 18 2020, 5:10 PM

Build is green

Patch application report for D4763 (id=16878)

Rebasing onto a6cef6bad5...

Current branch diff-target is up to date.
Changes applied before test
commit 87e1e1868e5a84ac064dfb418f0e37ca0b0c46cd
Author: Thibault Allançon <haltode@gmail.com>
Date:   Fri Dec 18 15:47:12 2020 +0100

    fs: history/by-date: invalidate .status inode when done

commit d5cd9667c7f8a95a4cb45f565ec900079850af52
Author: Thibault Allançon <haltode@gmail.com>
Date:   Fri Dec 18 09:52:24 2020 +0100

    fs: history/by-date: update .status count on read

See https://jenkins.softwareheritage.org/job/DFUSE/job/tests-on-diff/244/ for more details.

Build is green

Patch application report for D4763 (id=16879)

Rebasing onto a6cef6bad5...

Current branch diff-target is up to date.
Changes applied before test
commit 87e1e1868e5a84ac064dfb418f0e37ca0b0c46cd
Author: Thibault Allançon <haltode@gmail.com>
Date:   Fri Dec 18 15:47:12 2020 +0100

    fs: history/by-date: invalidate .status inode when done

commit d5cd9667c7f8a95a4cb45f565ec900079850af52
Author: Thibault Allançon <haltode@gmail.com>
Date:   Fri Dec 18 09:52:24 2020 +0100

    fs: history/by-date: update .status count on read

See https://jenkins.softwareheritage.org/job/DFUSE/job/tests-on-diff/245/ for more details.