Repository navigation
Conversation
|
PR Description updated to latest commit (6682b98) |
PR Analysis
PR Feedback
How to useInstructions
|
|
I will let it run a bit... |
|
Summary:
|
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
|
Summary:
|
Type
bug_fix
Description
This PR addresses a race condition between container start and activity reporting. The main changes include:
WaitGetSafeMaphas been added to safely retrieve the map for capabilities, execSets, and openSets.ReportCapability,ReportFileExec, andReportFileOpenfunctions inapplicationprofile_manager.gohave been updated to useWaitGetSafeMapand handle any errors it returns.applicationprofile_manager_test.gohas been updated to prepare the container before reporting capabilities, file execution, and file opening. These operations are also now run in goroutines to simulate concurrent execution.PR changes walkthrough
1 files
applicationprofile_manager.go
pkg/applicationprofilemanager/v1/applicationprofile_manager.go
The changes in this file are primarily focused on avoiding
race conditions between container start and activity
reporting. This is achieved by using a new utility function
WaitGetSafeMapto safely retrieve the map forcapabilities, execSets, and openSets. Error handling has
been added to return early if there is an error retrieving
the map.
1 files
applicationprofile_manager_test.go
pkg/applicationprofilemanager/v1/applicationprofile_manager_test.go
The changes in this file are related to the testing of the
changes made in
applicationprofile_manager.go. The changesinclude modifying the order of operations to prepare the
container before reporting capabilities, file execution, and
file opening. The operations are also now run in goroutines
to simulate concurrent execution.
1 files
utils.go
pkg/utils/utils.go
A new utility function
WaitGetSafeMaphas been added. Thisfunction waits for a value to be loaded into a SafeMap, with
a timeout of 1 minute. If the value is not loaded within the
timeout, it returns an error.