Skip to content

Async issues in 0.28 #2798

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

Open
ShovelJockey opened this issue Mar 13, 2025 · 3 comments
Open

Async issues in 0.28 #2798

ShovelJockey opened this issue Mar 13, 2025 · 3 comments

Comments

@ShovelJockey
Copy link

When using the otlp crate http-proto/reqwest-client and the sdk crate with rt-tokio/experimental trace batch I need to use .with_http_client with the SpanExporterBuilder otherwise the builder fails with NoHttpClient error.

I am using:

Let span_exporter = SpanExporter:builder().with_http().with_export_config(config).build()?

Adding with_http_client(Client::builder().build().unwrap())

Prevents the error but having a look at the code I am not sure why its needed or would a make a difference over the new standard non-async setup.

I am also finding that using a BatchSpanProcessor with the Tokio runtime in tests causes the trace provider shutdown to hang indefinitely.

We are mostly happy at moving to a sync exporter but want to keep the option for an async exporter setup for projects that wont support threading.

@cijothomas
Copy link
Member

Can you share a minimal repro for the issue(s) you are observing?

We have added good amount of tests to make sure how hangs/deadlocks occur in shutdowns, but these are only in the newly written BatchProcessor. It is unlikely to be ported to the async based ones. (We do plan to support async runtimes, but it would be likely by modifying the new BatchProcessor implementaions)

@ShovelJockey
Copy link
Author

Will have to check as its not my personal code, shutdown works fine when using the tokio current thread runtime however.

Which ultimately should be fine as if we are ok with multi-threading we should use the new sync threaded implementation.

If I am correctly understanding that the difference between tokio and tokio current thread is that the later is single threaded only?

@cijothomas
Copy link
Member

If I am correctly understanding that the difference between tokio and tokio current thread is that the later is single threaded only?

I think yes, but I am not an expert in tokio runtimes, so this is better asked to someone more experienced with this.

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

2 participants