temporary: Dump the threads stack traces when .wait_task() times out

Signed-off-by: Martin Tzvetanov Grigorov <mgrigorov@apache.org>
This commit is contained in:
Martin Tzvetanov Grigorov 2025-06-06 09:51:18 +03:00
parent 3770e70581
commit 89c0cf9b12
No known key found for this signature in database
GPG key ID: 3194FD8C1AE300EF
3 changed files with 15 additions and 6 deletions

View file

@ -400,12 +400,8 @@ impl<State> Server<State> {
// try several times to get status, or panic to not wait forever
let url = format!("/tasks/{}", update_id);
// Increase timeout for vector-related tests
let max_attempts = if url.contains("/tasks/") {
if update_id > 1000 {
400 // 200 seconds for vector tests
} else {
100 // 50 seconds for other tests
}
let max_attempts = if update_id > 1000 {
400 // 200 seconds for vector tests
} else {
100 // 50 seconds for other tests
};
@ -421,6 +417,14 @@ impl<State> Server<State> {
// wait 0.5 second.
sleep(Duration::from_millis(500)).await;
}
let handle = tokio::runtime::Handle::current();
if let Ok(dump) = tokio::time::timeout(Duration::from_secs(2), handle.dump()).await {
for (i, task) in dump.tasks().iter().enumerate() {
let trace = task.trace();
println!("TASK {i}:");
println!("{trace}\n");
}
}
panic!("Timeout waiting for update id");
}