summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKornel <kornel@geekhood.net>2020-03-01 02:08:21 +0000
committerKornel <kornel@geekhood.net>2020-03-01 02:08:30 +0000
commitaa7e50688b86f62d3feecca4282a739bbfbb57f6 (patch)
treee74f64b3a35f440b21c29fa9c9b7667219fbdf9c
parent90d2ead9157a1921fc6324ec6402d9ed8dd22774 (diff)
Kill server on tokio lockup
-rw-r--r--server/Cargo.toml2
-rw-r--r--server/src/main.rs5
2 files changed, 4 insertions, 3 deletions
diff --git a/server/Cargo.toml b/server/Cargo.toml
index 2dc2aaf..a764145 100644
--- a/server/Cargo.toml
+++ b/server/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "crates-server"
-version = "0.12.6"
+version = "0.12.7"
authors = ["Kornel <kornel@geekhood.net>"]
edition = "2018"
description = "Crates.rs web server"
diff --git a/server/src/main.rs b/server/src/main.rs
index b6ec2b8..02cad11 100644
--- a/server/src/main.rs
+++ b/server/src/main.rs
@@ -715,8 +715,9 @@ impl ServerError {
for cause in err.iter_chain() {
eprintln!("• {}", cause);
// The server is stuck and useless
- if cause.to_string().contains("Too many open files") {
- eprintln!("Fatal error. Too many open files.");
+ let s = cause.to_string();
+ if s.contains("Too many open files") || s.contains("inconsistent park state") || s.contains("failed to allocate an alternative stack") {
+ eprintln!("Fatal error: {}", s);
std::process::exit(2);
}
}