structure.
* Creates FileWatcher, in lqos_utils.
* Removes "notify" dependency from other crates.
FileWatcher is designed to watch a file. If the file doesn't exist,
then an optional callback is called - and the watcher waits,
periodically checking to see if the file has appeared yet. When the
file appears, another optional callback is executed.
Once the file exists, a `notify` system is started (it uses Linux's
`inotify` system internally) for that file. When the file changes,
the process sleeps briefly and then executes an `on_change` callback.
Further messages are then suppressed for a short period to avoid
duplicates.
All uses of notify have been updated to use this system. Errors are
handled cleanly, per ISSUE #209.
* ShapedDevices.csv may not exist on first run.
* This previously caused lqos_node_manager to emit a hard error
and not show any shaped devices at all.
To rectify this:
* ShapedDevices in-memory starts as an empty set.
* When the "watcher" spawns, if the file exists then ShapedDecices
is loaded.
* If the "watcher" can't find ShapedDevices, it sleeps periodically
looking for the file to be created. Once created, it loads it
and starts the change monitor.
ISSUE #209
Using the inode watcher on a file that doesn't exist fails, and
was previously failing silently! This would result in queue
mappings not updating when LibreQoS.py was executed - even though
the queueingStructure.json file became available.
* Replace "anyhow" with specific errors.
* Track and log each step of the file monitor process for
queueingStructure.json
* If the watcher cannot start because the file doesn't exist,
the watcher loop sleeps for 30 seconds at a time (to keep
load very low) and checks if the file exists yet. If it does,
it loads it and then commences watching.
file descriptor.
* Remove the Tokio timer system.
* Replace with Linux's timer fd system.
* Add a watchdog to alert if we've somehow overrun the timer.
* Replace Tokio timers in the bandwidth/throughput monitor with
Linux timer file descriptors API.
* Instead of spawning a Tokio process, spawn an independent
thread for the bandwidth monitor.
* Queue timing is now provided by Linux "timer file descriptors"
instead of Tokio timers.
* Added an atomic bool to track "we're going faster than we should"
(it's true while executing), skip cycles if we ran out of time and
issue a warning.
* Queue tracking is no longer async, but is locked to its very own
thread.
* Queue watcher is now more verbose about any issues it encounters.
* Queue structures with children will now correctly track all the
children, avoiding the blank queue data issue.
It was hilarious that I already missed the new "bridge"
section in my first attempt. Imagine what it is like for the
users?
Pithy notes:
I think this is an artifact of history, as a bool.
disable_rxvlan = true
disable_txvlan = true
There are a zillion other options in ethtool -h for
coalesing things, besides this.
disable_offload = [ "gso", "tso", "lro", "sg", "gro" ]
We have a lot of configuration stuff, written in several very
different styles. We have hidden knowledge (like port numbers)
buried elsewhere. We have overly wordy variables names, and not
clear separation of each concept. We have a need to keep some
data secure (passwords to the apis), and others, need to be common.
Ideally there would be more of a secrets file for secrets to
point to, on the security case.
Having one file to rule them all is not exactly the right way
forward, but parsing one file *format* might prove simpler.
Please, everyone, think about how to best to express oneself,
I took a stab at it via this commit.
statistics, while lqtop still works.
1) Add warning and error logging to lqos_node_manager if any
part of the statistics gathering process fails.
2) (Hopefully temporarily) use the non-persistent bus client,
again logging any issues.
3) Improve the statistics gathering timer code.
deleting.
* Adjust the Python integration `delete_ip_mapping` function to
not require a secondary "upload" parameter - because the
Python code is unaware of whether there needs to be a
separation of the two at this point.
* Change ENOEXIST return code in BPF map delete to NOT be an
error - it indicates that there was nothing to do, rather
than something not working.
Affects ISSUE #206
* Add a blank node for [children] in the QueueNode parser.
* Add two unit tests to cover loading content with and without
[children] entries.
it returns readable error messages explaining where it encountered a problem.
* Adds the bus call to the Python-Rust bridge.
* Adjusts LibreQoS.py to call the new bridge code and alert if Rust can't
read the ShapedDevices.csv file.