From 693f4c58687acc70a9216299d30f796b180df2b1 Mon Sep 17 00:00:00 2001 From: James Sturtevant Date: Tue, 12 Dec 2023 21:50:10 +0000 Subject: [PATCH] Handle OS interruptions It is possible when the socket is being read we can receive an OS Interrupt. As this isn't a hard error, in this case retry instead of shutting down the ttrpc server Signed-off-by: James Sturtevant --- src/sync/server.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/sync/server.rs b/src/sync/server.rs index 09f36bd1..b562996a 100644 --- a/src/sync/server.rs +++ b/src/sync/server.rs @@ -363,6 +363,10 @@ impl Server { continue; } Ok(Some(conn)) => Arc::new(conn), + Err(e) if e.kind() == std::io::ErrorKind::Interrupted => { + error!("got interruption {:?}. Continue...", e); + continue; + } Err(e) => { error!("listener accept got {:?}", e); break;