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]
|
[alias]
|
||||||
xtask = "run --release --package xtask --"
|
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
|
uses: Swatinem/rust-cache@v2.7.8
|
||||||
- name: Run tests in debug
|
- name: Run tests in debug
|
||||||
uses: actions-rs/cargo@v1
|
uses: actions-rs/cargo@v1
|
||||||
|
env:
|
||||||
|
RUSTFLAGS: "--cfg tokio_unstable --cfg tokio_taskdump"
|
||||||
with:
|
with:
|
||||||
command: test
|
command: test
|
||||||
args: --locked --all
|
args: --locked --all
|
||||||
|
@ -400,12 +400,8 @@ impl<State> Server<State> {
|
|||||||
// try several times to get status, or panic to not wait forever
|
// try several times to get status, or panic to not wait forever
|
||||||
let url = format!("/tasks/{}", update_id);
|
let url = format!("/tasks/{}", update_id);
|
||||||
// Increase timeout for vector-related tests
|
// Increase timeout for vector-related tests
|
||||||
let max_attempts = if url.contains("/tasks/") {
|
let max_attempts = if update_id > 1000 {
|
||||||
if update_id > 1000 {
|
400 // 200 seconds for vector tests
|
||||||
400 // 200 seconds for vector tests
|
|
||||||
} else {
|
|
||||||
100 // 50 seconds for other tests
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
100 // 50 seconds for other tests
|
100 // 50 seconds for other tests
|
||||||
};
|
};
|
||||||
@ -421,6 +417,14 @@ impl<State> Server<State> {
|
|||||||
// wait 0.5 second.
|
// wait 0.5 second.
|
||||||
sleep(Duration::from_millis(500)).await;
|
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");
|
panic!("Timeout waiting for update id");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user