Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- **pools** Ping Redis every 15 seconds
- **pools** Enable `test_before_acquire` on SQLx
- **pools** Decrease SQLx `idle_timeout` to 3 minutes
- **pools** Set ClickHoue `idle_timeout` to 15 seconds
- **pools** Set ClickHouse `idle_timeout` to 15 seconds
- **api-helper** Box path futures for faster compile times

### Security

Expand All @@ -54,6 +55,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- **api-helper** Remove excess logging
- `user_identity.identities` not getting purged on create & delete
- **Bolt** Error when applying Terraform when a plan is no longer required
- **api-helper** Instrument path futures

## [23.2.0-rc.1] - 2023-12-01

Expand Down
2 changes: 1 addition & 1 deletion lib/api-helper/build/src/start.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ where
}
},
Err(err) => {
tracing::error!(?err, "http error");
tracing::error!(?err, "tokio spawn error");
return Ok(Response::builder()
.status(http::StatusCode::INTERNAL_SERVER_ERROR)
.body(Body::empty())?);
Expand Down
14 changes: 8 additions & 6 deletions lib/api-helper/macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ impl EndpointRouter {
};

quote! {
.try_or_else(|| async {
.try_or_else(|| rivet_operation::prelude::futures_util::FutureExt::boxed(tracing::Instrument::in_current_span(async {
router_config.prefix = #mount_prefix;

#mount_path::__inner(
Expand All @@ -189,7 +189,7 @@ impl EndpointRouter {
)
.await
.map(std::convert::Into::into)
}).await?
}))).await?
}
})
.collect::<Vec<_>>();
Expand All @@ -198,6 +198,7 @@ impl EndpointRouter {
pub struct Router;
impl Router {
#[doc(hidden)]
#[tracing::instrument(skip_all)]
pub async fn __inner(
shared_client: chirp_client::SharedClientHandle,
pools: rivet_pools::Pools,
Expand Down Expand Up @@ -227,6 +228,7 @@ impl EndpointRouter {
Ok(body.into())
}

#[tracing::instrument(skip_all)]
pub async fn handle(
shared_client: chirp_client::SharedClientHandle,
pools: rivet_pools::Pools,
Expand Down Expand Up @@ -526,7 +528,7 @@ impl Endpoint {
.collect::<syn::Result<Vec<_>>>()?;

Ok(quote! {
.try_or_else(|| async {
.try_or_else(|| rivet_operation::prelude::futures_util::FutureExt::boxed(tracing::Instrument::in_current_span(async {
// Unreverse path segments (they are stored in reverse)
let mut path_segments = router_config
.path_segments
Expand All @@ -547,7 +549,7 @@ impl Endpoint {
} else {
Ok(__AsyncOption::None)
}
}).await?
}))).await?
})
}
}
Expand Down Expand Up @@ -931,7 +933,7 @@ impl EndpointFunction {
tokio::sync::oneshot::channel::<(http::StatusCode, String)>();
tokio::task::Builder::new()
.name("api_helper::req_metrics_drop")
.spawn(async move {
.spawn(rivet_operation::prelude::futures_util::FutureExt::boxed(tracing::Instrument::in_current_span(async move {
// Wait for the request to complete or be
// cancelled
let complete_msg = metrics_complete_rx.await;
Expand Down Expand Up @@ -969,7 +971,7 @@ impl EndpointFunction {
])
.inc();
}
})?;
})))?;

let fut = #path(ctx, #(#arg_list),*);
let timeout = ::tokio::time::Duration::from_secs(50);
Expand Down