gitfs icon indicating copy to clipboard operation
gitfs copied to clipboard

Allow disabling idle mode

Open jpohjolainen opened this issue 9 years ago • 8 comments

Is there a possibility to refresh the mount somehow?

jpohjolainen avatar Apr 18 '16 15:04 jpohjolainen

Hi @jpohjolainen,

gitfs has uses the FetchWorker in order to bring your changes from upstream. The FetchWorker will fetch, by default, each 30 seconds (you can change the timeout at mount, using -o fetch_timeout=5, for 5 seconds).

If nothing was changed, for more than 5min on the filesystem, gitfs will enter in idle mode. In this mode, it fetches each 30min. You can modify those parameters using min_idle_times in order to change the amount of idle cycles until gitfs will go to idle mode (by default 10 times => 10 * 30 == 300 seconds == 5min) and idle_fetch_timeout to control the period of time between fetches, for idle mode.

If you waited more than 30min and your changes from upstream were not on gitfs, then it smells like a bug.

Do you see something in /var/lib/syslog?

You can run with debug=True in order to get more information.

vtemian avatar Apr 18 '16 15:04 vtemian

Ah ok. I haven't seen this explanation in the documents. I think it was is idle mode and that's why didn't refresh when I waited 10 minutes. I've now set those times and seems to update better.

btw. I don't see those min_idle_times or idle_fetch_timeout in the document here https://www.presslabs.com/gitfs/docs/arguments/ .

jpohjolainen avatar Apr 19 '16 08:04 jpohjolainen

Oh, sorry for inconvenience and thanks for pointing that out. I'll close this issue after the docs are up-to-date.

Thanks again!

vtemian avatar Apr 19 '16 08:04 vtemian

I've update the docs: https://www.presslabs.com/gitfs/docs/arguments/ https://www.presslabs.com/gitfs/docs/works/

vtemian avatar Apr 19 '16 08:04 vtemian

I have set these now: -ofetch_timeout=5 -oidle_fetch_timeout=30

but still it doesn't update it in idle mode in 30 seconds. no errors or anything in syslog.

jpohjolainen avatar Apr 19 '16 12:04 jpohjolainen

ah, it took 5 mintues. so the idle fetch time is controlled min_idle_times + idle_fetch_timeout? I thought the only the "when to enter idle mode" is controlled by those 2, but when in the idle mode, it would fetch it every idle_fetch_timeout.

so if I want to have it still in idle mode to fetch every 30s, I set min_idle_times to 1 and idle_fetch_timeout to 30? did I understood now correctly?

jpohjolainen avatar Apr 19 '16 12:04 jpohjolainen

Yeah, correctly, idle mode is controlled by min_idle_times and idle_fetch_timeout and in order to bypass the idle mode, you need to set idle_fetch_timeout to 30s.

For now, you don't have any other option to bypass the idle mode, but I'm thinking to introduce a new argument idle_mode, which by default is true and if you want to disable, you can mount it with idle_mode=false.

vtemian avatar Apr 19 '16 12:04 vtemian

+1 for the idle mode argument. we're using this maybe a little differently than other as we just want to mount private repo as config file endpoint on servers. we're not using gitfs for development or do anything in the repo. more like just a read-only config dir.

jpohjolainen avatar Apr 19 '16 12:04 jpohjolainen