mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-06-15 12:31:35 +02:00
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:
parent
3770e70581
commit
89c0cf9b12
@ -1,2 +1,5 @@
|
||||
[alias]
|
||||
xtask = "run --release --package xtask --"
|
||||
|
||||
[build]
|
||||
rustflags = ["--cfg", "tokio_unstable", "--cfg", "tokio_taskdump"]
|
||||
|
2
.github/workflows/test-suite.yml
vendored
2
.github/workflows/test-suite.yml
vendored
@ -158,6 +158,8 @@ jobs:
|
||||
uses: Swatinem/rust-cache@v2.7.8
|
||||
- name: Run tests in debug
|
||||
uses: actions-rs/cargo@v1
|
||||
env:
|
||||
RUSTFLAGS: "--cfg tokio_unstable --cfg tokio_taskdump"
|
||||
with:
|
||||
command: test
|
||||
args: --locked --all
|
||||
|
@ -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");
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user