Skip to content
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

Add test to validate log shutdown #1620

Merged

Conversation

cijothomas
Copy link
Member

@cijothomas cijothomas commented Mar 13, 2024

Related to #1514, not quite the finish, but just a initial test.

@cijothomas cijothomas requested a review from a team as a code owner March 13, 2024 17:51
Copy link

codecov bot commented Mar 13, 2024

Codecov Report

Attention: Patch coverage is 90.00000% with 8 lines in your changes are missing coverage. Please review.

Project coverage is 68.3%. Comparing base (a8b308a) to head (26e8e64).
Report is 2 commits behind head on main.

Files Patch % Lines
opentelemetry-sdk/src/logs/log_emitter.rs 90.0% 8 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##            main   #1620     +/-   ##
=======================================
+ Coverage   67.8%   68.3%   +0.4%     
=======================================
  Files        139     139             
  Lines      19687   19806    +119     
=======================================
+ Hits       13363   13530    +167     
+ Misses      6324    6276     -48     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@lalitb lalitb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Nice way to validate the scenario described in #1514 :)

@lalitb
Copy link
Member

lalitb commented Mar 14, 2024

In a diff. test, I intend to test that it is indeed causing the effect of flush(), but not necessarily by calling flush() itself.

Looking into the batch processor code, it seems to be doing the flush before shutdown. But good to validate this in separate test.

BatchMessage::Shutdown(ch) => {
let result = export_with_timeout(
config.max_export_timeout,
exporter.as_mut(),
&timeout_runtime,
logs.split_off(0),
)
.await;

@cijothomas cijothomas requested review from lalitb and hdost March 14, 2024 06:34
@cijothomas
Copy link
Member Author

@hdost @lalitb Could you re-review? I added a separate-thread-logger scenario too.

@cijothomas
Copy link
Member Author

In a diff. test, I intend to test that it is indeed causing the effect of flush(), but not necessarily by calling flush() itself.

Looking into the batch processor code, it seems to be doing the flush before shutdown. But good to validate this in separate test.

BatchMessage::Shutdown(ch) => {
let result = export_with_timeout(
config.max_export_timeout,
exporter.as_mut(),
&timeout_runtime,
logs.split_off(0),
)
.await;

yes. that'd be a targetted test for processors to ensure shutdown() gives same effect as force_flush().

Copy link
Member

@lalitb lalitb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice :)

@cijothomas
Copy link
Member Author

@hdost @TommyCpp I'll go ahead and merge this to continue working on this. Please let me know if you have any feedback on this approach.

@cijothomas cijothomas merged commit 9f0ac7d into open-telemetry:main Mar 14, 2024
17 checks passed
@cijothomas cijothomas deleted the cijothomas/log-shutdown-test branch March 14, 2024 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants