From 46ce53c785b20eb052bd012de672499491d34231 Mon Sep 17 00:00:00 2001 From: Niko Date: Thu, 30 Nov 2023 17:37:31 -0700 Subject: [PATCH] Fix hangs when a STT service runs out of file descriptors --- scripty_stt/src/load_balancer.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripty_stt/src/load_balancer.rs b/scripty_stt/src/load_balancer.rs index 2ab10085..d7c599d5 100644 --- a/scripty_stt/src/load_balancer.rs +++ b/scripty_stt/src/load_balancer.rs @@ -130,7 +130,9 @@ impl LoadBalancedStream { ))); } - Stream::new(language, verbose, self.peer_address).await + let res = Stream::new(language, verbose, self.peer_address).await; + self.is_in_error.store(res.is_err(), Ordering::Relaxed); + res } pub async fn new(peer_address: SocketAddr) -> io::Result {