geesefs icon indicating copy to clipboard operation
geesefs copied to clipboard

Lazy init

Open gilbsgilbs opened this issue 1 year ago • 0 comments

When mounting a bucket, the current implementation makes an initialization step which consists in sending a bunch of HEAD requests to the bucket. If that initialization step fails (say, the endpoint is down or you are not connected to the internet yet), geesefs will just crash with some error like Unable to mount file system, see syslog for details.

I'm in a case where this behavior is not really desirable for two reasons:

  • I'm mounting the filesystem at boot (in fstab), which means I almost never want the mount to fail. I prefer having an unusable but mounted FS rather than an unmounted FS, because it mitigates the risk of writing files in an unmounted folder.
  • Most importantly: my S3 endpoint is hosted locally, which means it is not up at boot. (Yeah, that's kind of niche use-case, I agree)

My current workaround is to comment out the Init step completely because it turns out it doesn't do anything useful for me. If I make a R/W early, I get a Input/output error from system, but the mount never fails which is exactly what I want. As soon as the server is up, the mountpoint starts working as expected.

Would you be open to some "--lazy-init" flag, where this initialization step would be postponed until after the mount? In theory, it should be possible to do this initialization on the first data access, but I don't know how intrusive and ugly it would be to implement. Let me know what you think.

gilbsgilbs avatar Mar 03 '23 20:03 gilbsgilbs