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

remove polling watcher #1444

Closed
extrawurst opened this issue Nov 22, 2022 · 2 comments · Fixed by #1657
Closed

remove polling watcher #1444

extrawurst opened this issue Nov 22, 2022 · 2 comments · Fixed by #1657
Milestone

Comments

@extrawurst
Copy link
Owner

extrawurst commented Nov 22, 2022

notify based PollWatcher does a ton of caching and can be expensive in giant repos. the new --polling arg should sidestep using notify entirely and go back to a regular status polling

@cruessler
Copy link
Contributor

@extrawurst Can you provide a bit more context on the changes needed? Is this related to the lines of code below? I’m not sure I completely understand this issue yet.

gitui/src/watcher.rs

Lines 84 to 97 in 3e0ec29

if poll {
let config = Config::default()
.with_poll_interval(Duration::from_secs(2));
let mut bouncer = new_debouncer_opt::<_, PollWatcher>(
timeout, None, tx, config,
)
.expect("Watch create error");
bouncer
.watcher()
.watch(Path::new(&workdir), RecursiveMode::Recursive)
.expect("Watch error");
std::mem::forget(bouncer);
} else {

@extrawurst
Copy link
Owner Author

extrawurst commented Apr 17, 2023

More and more people struggle with this new notify based solution. it seems brittle and not well working on some platforms. I am currently leaning towards reverting back to the old approach (poll every few seconds) and provide a new program arg --watcher that will use the current default which is using the notify crate.

using the PollWatcher as the alternative is less performant because it does cache file hashes which in giant repos can still be unscalable. before I added notify (#1) we basically just triggered a Status refresh after a certain sleep - I think it was 2 seconds - to make sure we pick up when new diffs or so arrived.

hope that makes the idea here more clear

cruessler added a commit to cruessler/gitui that referenced this issue Apr 17, 2023
This commit reintroduces code that was previously removed in favor of a
notify-based update trigger. It turned out that notify-based updates can
cause issues in larger repositories, so tick-based updates seemed like a
safer default.

extrawurst#1444
extrawurst#1310
extrawurst pushed a commit that referenced this issue Apr 29, 2023
* Default to tick-based updates

This commit reintroduces code that was previously removed in favor of a
notify-based update trigger. It turned out that notify-based updates can
cause issues in larger repositories, so tick-based updates seemed like a
safer default.

#1444
#1310

* Add FAQ entry for --watcher

* Remove --poll
IndianBoy42 pushed a commit to IndianBoy42/gitui that referenced this issue Jun 4, 2024
* Default to tick-based updates

This commit reintroduces code that was previously removed in favor of a
notify-based update trigger. It turned out that notify-based updates can
cause issues in larger repositories, so tick-based updates seemed like a
safer default.

extrawurst#1444
extrawurst#1310

* Add FAQ entry for --watcher

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

Successfully merging a pull request may close this issue.

2 participants