-
Notifications
You must be signed in to change notification settings - Fork 500
[SDK] Fixes duration overflow #3529
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
[SDK] Fixes duration overflow #3529
Conversation
✅ Deploy Preview for opentelemetry-cpp-api-docs canceled.
|
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 removes unnecessary nanosecond conversions to prevent overflow and simplifies timeout handling by working directly with std::chrono::microseconds
.
- Eliminates casting to
nanoseconds
and unused overflow logic. - Updates
ForceFlush
andShutdown
to use microseconds consistently. - Adjusts expiration-time calculations accordingly.
Comments suppressed due to low confidence (2)
sdk/src/logs/multi_log_record_processor.cc:77
- Consider adding unit tests for edge cases where
timeout
approachessystem_clock::time_point::max
to verify the new overflow logic under UBSAN.
bool MultiLogRecordProcessor::ForceFlush(std::chrono::microseconds timeout) noexcept
sdk/src/logs/multi_log_record_processor.cc:4
- [nitpick] The header is added but no algorithms from it are used in this file. Consider removing it to keep includes minimal.
#include <algorithm>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3529 +/- ##
==========================================
+ Coverage 89.96% 89.98% +0.02%
==========================================
Files 219 219
Lines 7051 7044 -7
==========================================
- Hits 6343 6338 -5
+ Misses 708 706 -2
🚀 New features to boost your workflow:
|
[SDK] Fixes duration overflow (open-telemetry#3529)
Fixes #3528
Changes
8000 For significant contributions please make sure you have completed the following items:
CHANGELOG.md
updated for non-trivial changes