-
Notifications
You must be signed in to change notification settings - Fork 497
[BUILD] Cleanup cppcheck warnings #3619
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
Conversation
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.
Pull Request Overview
This PR addresses cppcheck warnings by refactoring destructors to avoid virtual function calls during object destruction. The main change introduces Internal*
methods that perform the actual work, allowing destructors to call non-virtual methods while preserving the existing public API.
- Introduces
Internal*
methods for shutdown operations across multiple processor classes - Refactors destructors to call internal methods instead of virtual functions
- Updates CI configuration to fail builds on any cppcheck warnings
Reviewed Changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
sdk/src/trace/batch_span_processor.cc | Refactors shutdown logic with InternalShutdown method |
sdk/src/logs/multi_log_record_processor.cc | Adds internal methods for ForceFlush and Shutdown operations |
sdk/src/logs/batch_log_record_processor.cc | Implements InternalShutdown method pattern |
sdk/include/opentelemetry/sdk/trace/simple_processor.h | Moves destructor and adds InternalShutdown method |
sdk/include/opentelemetry/sdk/trace/multi_span_processor.h | Refactors destructor to use InternalShutdown |
sdk/include/opentelemetry/sdk/trace/batch_span_processor.h | Adds InternalShutdown method declaration and documentation |
sdk/include/opentelemetry/sdk/logs/multi_log_record_processor.h | Declares internal methods with updated documentation |
sdk/include/opentelemetry/sdk/logs/batch_log_record_processor.h | Adds InternalShutdown method declaration |
sdk/include/opentelemetry/sdk/common/circular_buffer.h | Fixes variable declaration for cppcheck warning |
ext/src/http/client/curl/http_client_curl.cc | Refactors CancelAllSessions with internal implementation |
ext/include/opentelemetry/ext/http/client/curl/http_client_curl.h | Declares InternalCancelAllSessions method |
.github/workflows/cppcheck.yml | Updates CI to fail on any cppcheck warnings and fixes formatting |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
* Shuts down the processor and does any cleanup required. Completely drains the buffer/queue of | ||
* all its logs and passes them to the exporter. |
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.
The InternalShutdown method documentation is incomplete. It should include @param timeout and @return documentation to match the method signature, similar to the public Shutdown method documentation.
* Shuts down the processor and does any cleanup required. Completely drains the buffer/queue of | |
* all its logs and passes them to the exporter. | |
* all its logs and passes them to the exporter. | |
* | |
* @param timeout The maximum time to wait for shutdown to complete. | |
* @return true if the shutdown completed successfully within the timeout, false otherwise. |
Copilot uses AI. Check for mistakes.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3619 +/- ##
==========================================
- Coverage 90.06% 90.03% -0.02%
==========================================
Files 220 220
Lines 7069 7081 +12
==========================================
+ Hits 6366 6375 +9
- Misses 703 706 +3
🚀 New features to boost your workflow:
|
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.
LGTM, thanks for the cleanup.
The CLA problem is for copilot, anyway to ignore it? |
@owent - This shouldn't happen. for now, can you stash/rebase all the commits in this PR - so that commit is ONLY authored by you ? |
Seems suggestion from Copiot should be be applied directly, as it is authored by copilot. |
/easycla |
fb163bb
to
58a4637
Compare
58a4637
to
4387072
Compare
OK, rebase to remove copilot information now. |
Fixes #3618
Changes
For significant contributions please make sure you have completed the following items:
CHANGELOG.md
updated for non-trivial changes