-
Notifications
You must be signed in to change notification settings - Fork 440
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
Change Shutdown() and ForceFlush() to return bool for traces #419
Conversation
Codecov Report
@@ Coverage Diff @@
## master #419 +/- ##
==========================================
- Coverage 94.53% 94.50% -0.03%
==========================================
Files 179 178 -1
Lines 7702 7701 -1
==========================================
- Hits 7281 7278 -3
- Misses 421 423 +2
|
docs/cpp-ostream-exporter-design.md
Outdated
@@ -111,9 +111,10 @@ public: | |||
return sdktrace::ExportResult::kSuccess; | |||
} | |||
|
|||
void Shutdown(std::chrono::microseconds timeout = std::chrono::microseconds(0)) noexcept | |||
bool Shutdown(std::chrono::microseconds timeout = std::chrono::microseconds(-1)) noexcept |
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.
nit: should it be std::chrono::microseconds::max()
?
*/ | ||
void Shutdown( | ||
std::chrono::microseconds timeout = std::chrono::microseconds(0)) noexcept override{}; | ||
bool Shutdown(std::chrono::microseconds timeout = std::chrono::microseconds(0)) noexcept override{ |
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.
I know timeout is not used here, but we are setting it's default as max at some places and 0 at other (including here). Is it intended ?
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.
+1 We shouldn't specify defaults in overridden methods. AFAIK it should pull the default from the base type.
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.
Seems overrider doesn't acquire the defaults from base class.
8.3.6.10:
A virtual function call (10.3) uses the default arguments in the declaration of the virtual function determined by the static type of the pointer or reference denoting the object. An overriding function in a derived class does not acquire default arguments from the function it overrides. Example:
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.
+1 to returning bool
, looks like one syntax error is breaking tests.
exporters/otlp/include/opentelemetry/exporters/otlp/otlp_exporter.h
Outdated
Show resolved
Hide resolved
*/ | ||
void Shutdown( | ||
std::chrono::microseconds timeout = std::chrono::microseconds(0)) noexcept override{}; | ||
bool Shutdown(std::chrono::microseconds timeout = std::chrono::microseconds(0)) noexcept override{ |
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.
+1 We shouldn't specify defaults in overridden methods. AFAIK it should pull the default from the base type.
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
Triaged Dec 7 2020: Need another reviewer to complete review. @jsuereth can you please take a look? |
Approved, but before merging we should have a look why the Bazel asan test fails (maybe it's just a temporary issue). |
@ThomsonTan Do you think if error in bazel asan test is related to this PR. Seems its failing consistently: |
Looking at ASAN the failure. |
The ASAN failure was caused by assigned |
Thanks @ThomsonTan . @jsuereth its blocked for your review now : ) |
This resolves #400. The default timeout is also set to
std::chrono::microseconds::max()
as the spec requiresShutdown() Shutdown should not block indefinitely
.