Skip to content

Commit

Permalink
tail: reduce CPU load for polling
Browse files Browse the repository at this point in the history
This reduces the CPU load for polling drastically (from ~80% down to ~5%)
by removing/fixing several previous workarounds related to polling,
while still passing all related GNU test-suite checks.
* set Notify::PollWatcher delay to: sleep_sec/10 instead of
  sleep_sec/100
* set recv_timeout to sleep_sec instead of sleep_sec/100
* remove the manual polling of watched files

Bugs:
* fix an issue with headers to consistently pass
"test_follow_name_retry_headers" and "gnu/tests/tail-2/overlay-headers.sh"

Code clean-up and refactor
* make fields of struct FileHandling private (and add getters/setters)
to ensure that the paths are absolute and match the paths returned by
Notify::Events
* replace calls to "crash!" with "return USimpleError"
* clean-up formatting
  • Loading branch information
jhscheer committed Jun 12, 2022
1 parent 0483e8c commit 2b7f49a
Showing 1 changed file with 384 additions and 333 deletions.
Loading

0 comments on commit 2b7f49a

Please sign in to comment.