spinframework / spinframework/spin
Sleeping in a Spin app breaks traces
Open
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 6.5k
- Forks
- 310
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 24
Description
Traces are not properly emitted when a Spin app sleeps.
The commit that introduced this regression is most likely here.
e.g.
use spin_sdk::http::{IntoResponse, Response};
use spin_sdk::http_component;
use spin_sdk::observe;
/// A simple Spin HTTP component.
#[http_component]
async fn hello_world(_req: http::Request<()>) -> anyhow::Result<impl IntoResponse> {
std::thread::sleep(std::time::Duration::from_millis(500));
Ok(Response::new(200, "Hello, world!"))
}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by inspecting commit 72cc02514e3506ddda357d03d2d060d8ad08f2b1 and reproduce the issue with the Rust HTTP component shown in the report. Trace the behavior while the component sleeps, then verify that the expected traces are emitted after the sleep completes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- observability
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100