You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When upgrading docs.rs itself to axum 0.8 I stumbled onto this issue.
use axum::{routing::get,Router};#[tokio::main]asyncfnmain(){let app = Router::new().route("/",get(|| async{"Hello, World!"})).layer(sentry_tower::NewSentryLayer::new_from_top());// this fails because the service is not `Sync` let listener = tokio::net::TcpListener::bind("0.0.0.0:3000").await.unwrap();
axum::serve(listener, app).await.unwrap();}
syphar
changed the title
sentry-tower: using the layer breaks with axum ~0.8 because it's !Sync
sentry-tower: using the layer breaks with axum ~0.8 because it's not SyncJan 4, 2025
Environment
Steps to Reproduce
When upgrading docs.rs itself to axum 0.8 I stumbled onto this issue.
With axum 0.8 all Layers & services are expected to be
Sync
(tokio-rs/axum#2473).sentry_tower::SentryLayer
and::SentryService
are onlySync
if the givenRequest
isSync
, which the defaultaxum::request::Request
isn't.So my guess is that every axum user will run into this issue.
Expected Result
Since the
Request
is only used in a function argument in theHubProvider
, I assume that the service / layer could totally beSync
.Actual Result
potential solution?
From what I see, the solution could be something like this. It definitely compiles in docs.rs. I'm not sure about what tests would be expected.
The text was updated successfully, but these errors were encountered: