-
Notifications
You must be signed in to change notification settings - Fork 1
ROX-30836: implement hotreloading for monitored paths #120
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
Conversation
|
/retest |
1 similar comment
|
/retest |
080010c to
556f3c8
Compare
|
After discussing with @Stringy offline, we decided to attempt to implement this without detaching the LSM hooks to try and minimize the downtime. This is implemented as follow up in #128 in order to keep the number of changes in this PR down. Keep this in mind when reviewing parts of this code that are modified on that PR (or even better, review that PR first and I'll merge it into this one). |
Stringy
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One very minor nit, but otherwise LGTM
a75dddc to
642301c
Compare
35111ae to
04c7e8a
Compare
642301c to
5b2adad
Compare
04c7e8a to
a306241
Compare
This patch implements hotreloading for the monitored paths. In order to achieve this, the BPF worker will need to detach all LSM hooks before messing with the prefix path map in order to prevent any problems that may arise of events happening in undefined states. This is achieved by keeping a list of links for the programs and dropping them, then re-filling the list once the programs are re-attached. The path prefix map is cleared by keeping a copy of the list of paths that are being monitored, then the new list is added in and a copy of it is stored.
This patch makes it so detaching and reattaching programs is no longer needed for updating the list of monitored paths. This is achieved by first loading all the new paths into the BPF trie map and then removing the entries that are not part of the new configuration. An integration test was added to ensure adding new paths does not remove existing paths accidentally.
a306241 to
e219451
Compare
Description
This patch implements hotreloading for the monitored paths.
In order to achieve this, the BPF worker will need to detach all LSM hooks before messing with the prefix path map in order to prevent any problems that may arise of events happening in undefined states. This is achieved by keeping a list of links for the programs and dropping them, then re-filling the list once the programs are re-attached. The path prefix map is cleared by keeping a copy of the list of paths that are being monitored, then the new list is added in and a copy of it is stored.
Checklist
Automated testing
If any of these don't apply, please comment below.
Testing Performed
Tested manually and added an integration test.