to let the server finish starting.
The delay is in the polling thread, not global - so it doesn't
cause a stall, or affect data access. The ringbuffer will be
slightly delayed in starting (and show zeroes until then).
Testing shows no more logged messages on reboot.
ISSUE #235
into running files to avoid service interruption. The script
detects if you are using systemd (with the default names) and
will restart the services at the end of the process - for a
very brief interruption rather than several minutes.
Also suppresses pushd/popd output.
Related to ISSUE #208
ISSUE #52
* Added file locking commands to the Python/Rust library.
* When LibreQoS.py starts, it checks that /var/run/libreqos.lock
does not exist. If it does, it checks that it contains a PID
and that PID is not still running with a python process.
* If the lock file exists and is valid, execution aborts.
* If the lock file exists and is invalid, it is cleaned.
* Cleans the lock on termination.
boot time. ISSUE #235 . Also relevant to ISSUE #209
* Discovered that the BOOT_TIME clock can fail if called
immediately after boot.
* Refactored time fetching functions into `lqos_utils` with
proper error wrapping.
* Adjusted unknown IP expiration to issue a bus response of
"not ready yet" if the boot time clock is not available.
* Adjusted unknown IP expiration to handle 5-minutes in the
past being a negative number.
* Adjusted queue collection to suggest that you run
LibreQoS.py if queues don't exist - and fail gracefully,
without causing a hitch.
Remove the unused feature from notify. We actually moved notify
into a single crate (as opposed to all over the place) in
816ca7e651
As of this commit, build_rust runs without warnings.
* Corrected a lot of small issues like passing a string when a char
will be (marginally) faster.
* Cleaned up single-arm match statements for the much more compiler
friendly if let.
* Combined nested if statements.
* Cleaned all remaining unchecked unwrap() calls.
ISSUE #209
Replace "anyhow" with "thiserror". Add logging for all errors,
and only allow pass-through for errors that have already been
converted to a local error type and reported.
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.