Skip to content

Conversation

ExceptionalHandler
Copy link
Contributor

Description

This PR changes the way programs are loaded on Windows in order to support loading multiple programs from a single collection. Earlier implementation assumed one program per collection.
In Windows, a collection can be loaded only once per process. In that light, if a sensor had two programs from the same sys file, the loading of the second program would fail, as loading the collection second time around fails.

In the PR, we cache loaded collections by path and check the cache before loading a new collection. The second run will use the cached collection object and load the passed in program.

@ExceptionalHandler ExceptionalHandler requested a review from a team as a code owner June 17, 2025 15:08
@ExceptionalHandler ExceptionalHandler added the release-note/minor This PR introduces a minor user-visible change label Jun 17, 2025
@ExceptionalHandler ExceptionalHandler force-pushed the pr/windows/multi_program branch from 6fcfea3 to 0e1f3be Compare June 18, 2025 17:13
Copy link
Contributor

@olsajiri olsajiri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, left some comments

@ExceptionalHandler ExceptionalHandler force-pushed the pr/windows/multi_program branch from 0e1f3be to 0e096cc Compare June 19, 2025 15:04
This PR changes the way programs are loaded on Windows in order to
support loading multiple programs from a single collection. Earlier
implementation assumed one program per collection.
In Windows, a collection can be loaded only once per process. In that light,
if a sensor had two programs from the same sys file, the loading of the second
program would fail, as loading the collection second time around fails.

In the PR, we cache loaded collections by path and check the cache before
loading a new collection. The second run will use the cached collection
object and load the passed in program.

Signed-off-by: Anadi Anadi<[email protected]>
@ExceptionalHandler ExceptionalHandler force-pushed the pr/windows/multi_program branch from 0e096cc to e8c10d0 Compare June 19, 2025 16:47
@ExceptionalHandler ExceptionalHandler merged commit b0eca96 into cilium:main Jun 19, 2025
46 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note/minor This PR introduces a minor user-visible change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants