Skip to content

Conversation

@Molter73
Copy link
Collaborator

@Molter73 Molter73 commented Oct 20, 2025

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

  • Investigated and inspected CI test results
  • Updated documentation accordingly

Automated testing

  • Added unit tests
  • Added integration tests
  • Added regression tests

If any of these don't apply, please comment below.

Testing Performed

Tested manually and added an integration test.

@Molter73 Molter73 changed the title Mauro/rox 30836/hotreload paths ROX-30836: implement hotreloading for monitored paths Oct 20, 2025
@Molter73
Copy link
Collaborator Author

/retest

1 similar comment
@Molter73
Copy link
Collaborator Author

/retest

@Molter73 Molter73 force-pushed the mauro/ROX-30836/hotreload-paths branch from 080010c to 556f3c8 Compare October 22, 2025 10:48
@Molter73
Copy link
Collaborator Author

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).

Copy link
Contributor

@Stringy Stringy left a 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

@Molter73 Molter73 force-pushed the mauro/ROX-30836/hotreload-output branch from a75dddc to 642301c Compare October 29, 2025 11:32
@Molter73 Molter73 force-pushed the mauro/ROX-30836/hotreload-paths branch from 35111ae to 04c7e8a Compare October 29, 2025 11:33
@Molter73 Molter73 force-pushed the mauro/ROX-30836/hotreload-output branch from 642301c to 5b2adad Compare October 30, 2025 09:54
@Molter73 Molter73 force-pushed the mauro/ROX-30836/hotreload-paths branch from 04c7e8a to a306241 Compare October 30, 2025 09:55
Base automatically changed from mauro/ROX-30836/hotreload-output to main October 30, 2025 10:45
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.
@Molter73 Molter73 force-pushed the mauro/ROX-30836/hotreload-paths branch from a306241 to e219451 Compare October 30, 2025 10:46
@Molter73 Molter73 merged commit 36772c7 into main Oct 30, 2025
20 checks passed
@Molter73 Molter73 deleted the mauro/ROX-30836/hotreload-paths branch October 30, 2025 11:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants