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

Usage of block_on #498

Closed
LukeMathWalker opened this issue Mar 29, 2021 · 5 comments
Closed

Usage of block_on #498

LukeMathWalker opened this issue Mar 29, 2021 · 5 comments

Comments

@LukeMathWalker
Copy link
Contributor

LukeMathWalker commented Mar 29, 2021

I noticed that SimpleSpanProcessor uses futures::executor::block to export a span every time it closes.
This can be troublesome when running on single-threaded executors (e.g. in tests), leading to a blocking of the executor thread itself. I have been experiencing several test hangs when using SimpleSpanProcessor that immediately vanish when using the batch exporter and global::shutdown.

I feel it would be more sensible to make SpanProcessor::on_end asynchronous:

  • the simple exporter could simply await exporter.export;
  • the batch exporter could keep pushing exporting jobs to a background task.

Unfortunately I am not familiar with the overall architecture of the crate, so I do not have an appreciation for the impact on the API of such a change (that's why I am opening an issue instead of a PR 😁 )

@djc
Copy link
Contributor

djc commented Mar 29, 2021

Maybe review the interactions with #494 here?

@LukeMathWalker
Copy link
Contributor Author

I looked at #494, but I think the two issues are orthogonal - am I missing something here?

@TommyCpp
Copy link
Contributor

TommyCpp commented Mar 29, 2021

Yes #494 is unrelated. It aims to address the span drops problem when the volume of spans is too high. It doesn't really change anything in simple span processor

@jtescher
Copy link
Member

#502 may resolve some of the issues around blocking here.

@jtescher
Copy link
Member

@LukeMathWalker SpanProcessor::on_end now is a channel send in both span processors.

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

No branches or pull requests

4 participants