Return EBUSY if driver is still being unloaded #3794
Draft
+60
−5
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Resolves: #2133
Description
This pull request introduces a new error code
EBPF_BUSY
to handle situations where operations cannot be completed due to the system being busy. The changes span multiple files to integrate this new error code into the existing error handling framework.Error Handling Enhancements:
include/ebpf_result.h
: AddedEBPF_BUSY
to theebpf_result_t
enumeration to represent a busy system state.libs/api/ebpf_api.cpp
: Updated_ebpf_program_load_native
to mapEBPF_OBJECT_NOT_FOUND
toEBPF_BUSY
when the service is still being deleted.libs/api_common/api_common.hpp
: Modifiedebpf_result_to_errno
to convertEBPF_BUSY
to theEBUSY
error code.libs/runtime/ebpf_error.c
: AddedEBPF_BUSY
to the_ebpf_result_mapping
array to map it toSTATUS_DEVICE_BUSY
.libs/runtime/kernel/ebpf_native_kernel.c
: Adjustedebpf_native_load_driver
to setEBPF_OBJECT_NOT_FOUND
when the status isSTATUS_OBJECT_NAME_NOT_FOUND
.Testing Enhancements:
tests/api_test/api_test.cpp
: Added a loop to retry loading a BPF object if the system is busy and introduced a new test case for the program load/attach/detach/unload cycle. [1] [2]Testing
CI/CD
Documentation
No.
Installation
No.