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

clay: mounted desk retains files deleted on unix if there's a commit error on the first try #5667

Open
tinnus-napbus opened this issue Mar 25, 2022 · 6 comments
Labels

Comments

@tinnus-napbus
Copy link
Contributor

Describe the bug

If you |merge %foobar our %base, delete all the files in it on unix, copy your own files across, and then |commit but the commit fails for whatever reason, then when you fix the issue and recommit the files you deleted won't actually be deleted. This results in people unknowingly distributing the entire %base desk along with their app. It's particularly an issue if they're distributing a desk without their own desk.bill file, eg they're just distributing a glob webapp or whatever, cos it'll have the base desk desk.bill file and consequently start copies of all the base desk agents, which will shut down the actual base desk ones and transfer their state across.

To Reproduce
Steps to reproduce the behaviour:

  1. |merge %foobar our %base
  2. cd ~/piers/zod/foobar
  3. rm -r * .
  4. cp ~/your-desk/* .
  5. |commit %foobar
  6. (failure cos you missed a mark file dependency or whatever)
  7. you fix the issue
  8. you rerun |commit %foobar
  9. all the files you deleted are not deleted on %foobar, so your desk actually includes the whole %base desk, which you probably didn't notice unless you were paying careful attention to the commit printout in the dojo

Expected behaviour
If you delete files on unix they should be deleted upon |commit in all cases

Screenshots

See screen recording of reproducing bug

System (please supply the following information, if relevant):

  • OS: Arch linux x86-64 desktop

Additional context
This could account for why many 3rd party desks are seemingly distributing %base

Notify maintainers

@liam-fitzgerald

@tomholford
Copy link
Contributor

tomholford commented Mar 25, 2022

6.(failure cos you missed a mark file dependency or whatever)

While preparing for distribution of an app, I ran into the error described above a couple times. Even though the app is just a glob of JS & HTML, it takes up a significant amount of size as reported by |mass.

Here's a comparison of several desks, note the size of %hodl:

        %fafa: 
          %ankh: KB/4.488
          %mime: KB/4.512
          %ford-files: KB/492.208
          %ford-naves: B/0
          %ford-marks: B/0
          %ford-casts: B/0
          %ford-tubes: B/0
        --KB/501.208
        %garden: 
          %ankh: KB/64.556
          %mime: KB/12.668
          %ford-files: MB/1.804.396
          %ford-naves: KB/8.400
          %ford-marks: KB/104.816
          %ford-casts: KB/1.872
          %ford-tubes: KB/4.608
        --MB/2.001.316
        %gora: 
          %ankh: KB/5.784
          %mime: KB/4.648
          %ford-files: MB/2.699.372
          %ford-naves: B/0
          %ford-marks: B/0
          %ford-casts: B/0
          %ford-tubes: B/0
        --MB/2.709.804
        %hodl: 
          %ankh: MB/146.294.204
          %mime: MB/18.496.528
          %ford-files: MB/9.325.136
          %ford-naves: KB/182.356
          %ford-marks: KB/2.496
          %ford-casts: KB/7.104
          %ford-tubes: KB/3.960
        --MB/174.311.784

@tinnus-napbus
Copy link
Contributor Author

you should be able to tell definitively if you run +tree /=hodl=/sys or +tree /=hodl=/app or whatever and see a whole lot of files you didn't intend to include

@tomholford
Copy link
Contributor

you should be able to tell definitively if you run +tree /=hodl=/sys or +tree /=hodl=/app or whatever and see a whole lot of files you didn't intend to include

Looks like %base is indeed being included:

> +tree /=hodl=/app
/app/acme/hoon
/app/aqua/hoon
/app/azimuth/hoon
/app/azimuth/logs/eth-logs
/app/azimuth/version-0/azimuth-snapshot
/app/azimuth-rpc/hoon
/app/azimuth-tracker/hoon
/app/claz/hoon
/app/dbug/hoon
/app/debug/css/index/css
/app/debug/index/html
/app/debug/js/channel/js
/app/debug/js/index/js
/app/debug/js/tile/js
/app/dns-collector/hoon
/app/dojo/hoon
/app/eth-sender/hoon
/app/eth-watcher/hoon
/app/gaze/hoon
/app/herm/hoon
/app/hood/hoon
/app/language-server/hoon
/app/lens/hoon
/app/ping/hoon
/app/roller/hoon
/app/roller-rpc/hoon
/app/shoe/hoon
/app/spider/hoon
/app/test/hoon
/app/time/hoon
> +tree /=hodl=/sys
/sys/arvo/hoon
/sys/hoon/hoon
/sys/kelvin
/sys/lull/hoon
/sys/vane/ames/hoon
/sys/vane/behn/hoon
/sys/vane/clay/hoon
/sys/vane/dill/hoon
/sys/vane/eyre/hoon
/sys/vane/gall/hoon
/sys/vane/iris/hoon
/sys/vane/jael/hoon
/sys/zuse/hoon

@tinnus-napbus
Copy link
Contributor Author

If you run +agents %hodl, assuming you didn't delete the base desk's desk.bill file, you'll see that your desk is running all the base agents. I believe you'll need to |rein %base to stop them on %hodl and start them again on %base. This could be a problem for people who've installed your app

@tinnus-napbus
Copy link
Contributor Author

cos your desk will have basically stolen the state of all the base agents

@ynx0
Copy link
Contributor

ynx0 commented Mar 27, 2022

%hodl is the new %base

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants