-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Refactoring and deadlock solution of wazuhDBWrapper
#23358
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Dwordcito
reviewed
May 11, 2024
48fa0da
to
338fba5
Compare
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.
Nice work @GabrielEValenzuela!
src/wazuh_modules/vulnerability_scanner/tests/unit/osDataCache_test.cpp
Outdated
Show resolved
Hide resolved
src/wazuh_modules/vulnerability_scanner/tests/component/vulnerabilityScannerFacade_test.cpp
Show resolved
Hide resolved
src/wazuh_modules/vulnerability_scanner/qa/test_data/008/expected_001.out
Outdated
Show resolved
Hide resolved
src/wazuh_modules/vulnerability_scanner/qa/test_data/008/expected_002.out
Outdated
Show resolved
Hide resolved
src/wazuh_modules/vulnerability_scanner/qa/test_data/008/expected_003.out
Outdated
Show resolved
Hide resolved
…wazuh into bug/23301_deadlock_wazuhdbwrapper
Dwordcito
approved these changes
May 13, 2024
sebasfalcone
added a commit
that referenced
this pull request
May 15, 2024
pereyra-m
pushed a commit
that referenced
this pull request
May 16, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Objective
This PR aims to overhaul the
socketDBWrapper
class by implementing a blocking approach to socket operations and converting the class to use a singleton pattern. This refactor enhances the efficiency and manageability of socket interactions throughout our application. Additionally, we have refactored the unit tests to align with these changes and ensure comprehensive coverage and reliability.Description
socketDBWrapper
class was identified as a deadlock, particularly in scenarios with high concurrency and rapid socket operations.socketDBWrapper
to a blocking model, which simplifies the management of socket operations and ensures that each operation is completed before proceeding. This change is expected to improve the stability and performance of network communications.socketDBWrapper
into a singleton to prevent multiple instances from being created. This ensures that socket operations are centralized and managed consistently throughout the application's lifecycle.socketDBWrapper
were also overhauled to reflect these changes. New tests were added to specifically assess the blocking behavior and the singleton instance management, ensuring that the class functions correctly under various scenarios and that thread safety and singleton properties are maintained.Quality Assurance
Static Analysis
Testing
Unit Testing
Integration Testing
N/A