Conversation
There was a problem hiding this comment.
Pull request overview
This PR implements a comprehensive real-time sensors mechanism for the SysInspect system, enabling cross-platform monitoring of system changes with low resource overhead. The implementation adds sensor configuration parsing, a service runner for sensor probes, file listener capabilities, and event routing to handlers.
Changes:
- Added new
libsensorscrate with sensor specification parser, service runner, and fsnotify sensor implementation - Updated event routing format from forward-slash delimiters (
/) to pipe delimiters (|) for better parsing - Enhanced EventProcessor with drain functionality and improved lifecycle management
- Extended protocol with
SensorsSyncRequestandSensorsSyncResponsemessage types - Added sensors directory configuration and file synchronization support in minion/master
Reviewed changes
Copilot reviewed 49 out of 50 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| libsensors/* | New crate implementing sensor specification parsing, service management, and fsnotify sensor |
| sysminion/src/minion.rs | Added sensor synchronization, file download, and event processor integration |
| sysminion/src/filedata.rs | Added SensorsFiledata for managing sensor file checksums and paths |
| sysminion/src/main.rs | Configured multi-threaded tokio runtime with explicit worker/blocking thread limits |
| sysmaster/src/master.rs | Added sensors file serving and sync response message handling |
| sysmaster/src/dataserv/fls.rs | Enhanced file server initialization to create sensors directory structure |
| libsysproto/* | Added new request types and sensors_root field to payload structures |
| libsysinspect/src/intp/actproc/response.rs | Implemented from_sensor() and enhanced matching with @ specifier support |
| libsysinspect/src/reactor/* | Renamed Config to EventsConfig, added drain_all method, improved JSONPath interpolation |
| libsysinspect/src/cfg/mmconf.rs | Added sensors directory configuration methods for minion/master |
| libdpq/src/lib.rs | Added EventCommand variant to WorkItem enum |
| docs/* | Updated documentation for event routing format change and added sensor documentation |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
sysminion/src/minion.rs
Outdated
There was a problem hiding this comment.
The event pump loop on line 293-301 runs forever without any shutdown mechanism. This spawned task will continue running even if the sensors need to be stopped or restarted. Consider adding a cancellation mechanism (e.g., using tokio::select! with a shutdown signal) or storing the JoinHandle for proper lifecycle management.
This PR adds ability to detect system changes in real time, adding sensors mechanism.
Goals:
/dev/nulllol)Done: