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

[EXPORTER] OTLP HTTP session canceled after a flush, with async export #2715

Closed
TheodoreG opened this issue Jun 25, 2024 · 2 comments · Fixed by #2727
Closed

[EXPORTER] OTLP HTTP session canceled after a flush, with async export #2715

TheodoreG opened this issue Jun 25, 2024 · 2 comments · Fixed by #2727
Labels
bug Something isn't working triage/accepted Indicates an issue or PR is ready to be actively worked on.

Comments

@TheodoreG
Copy link

TheodoreG commented Jun 25, 2024

Describe your environment Hey guys, I ran into the same problem wit #1955 my side, some error ocassionally occured, and it may be due to http response latency described in #1955. Can someone helps, thanks.

version v1.15.0
cmake command:
CC=gcc-11 CXX=g++11 cmake .. -DBUILD_TESING=ON -DWITH_OTLP_HTTP=ON -DOTELCPP_PROTO_PATH=XXXX/opentelemetry-proto-1.2.0 -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release -DOPENTELEMETRY_INSTALL=ON -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DWITH_ASYNC_EXPORT_PREVIEW=ON

Steps to reproduce
./examples/otlp/example_otlp_http 0.0.0.0:4318/v1/traces

otel collector config
92896800-9e79-48cd-b0f5-8610f6d9949d

What is the expected behavior?
Should be no error.

What is the actual behavior?
Print error:
67894df3-96d3-47b4-96ec-f68e7f2a7f4d

Additional context
it seems I have the same problem with #1955. I find the issue is closed while the located code has no change.

@TheodoreG TheodoreG added the bug Something isn't working label Jun 25, 2024
@github-actions github-actions bot added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Jun 25, 2024
@marcalff marcalff changed the title Same problem with https://github.com/open-telemetry/opentelemetry-cpp/issues/1955 [EXPORTER] OTLP HTTP session canceled after a flush, with async export Jun 25, 2024
@marcalff
Copy link
Member

Thanks for the report.

Using opentelemetry-1.16.0 with WITH_ASYNC_EXPORT_PREVIEW=OFF: can not reproduce

Using opentelemetry-1.16.0 with WITH_ASYNC_EXPORT_PREVIEW=ON: reproduced

The example code example_otlp_http invokes ForceFlush(), which is supposed to wait for spans to be exported.

It seems ForceFlush() is not working for async export, to investigate.

Note that related issue #1955 was fixed by #2000, saying it was closed without being fixed is incorrect.

@owent
Copy link
Member

owent commented Jun 26, 2024

Thanks for the report.

Using opentelemetry-1.16.0 with WITH_ASYNC_EXPORT_PREVIEW=OFF: can not reproduce

Using opentelemetry-1.16.0 with WITH_ASYNC_EXPORT_PREVIEW=ON: reproduced

The example code example_otlp_http invokes ForceFlush(), which is supposed to wait for spans to be exported.

It seems ForceFlush() is not working for async export, to investigate.

Note that related issue #1955 was fixed by #2000, saying it was closed without being fixed is incorrect.

The problem is providers will forceflush and then shutdown when destroying before, and them only will shutdown now.
I will change the behavious of http client to call forceflush first to solve this problem.

@marcalff marcalff added triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Jul 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants