Skip to content

Commit 693f4c5

Browse files
committed
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 <[email protected]>
1 parent 6fe7d39 commit 693f4c5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Diff for: src/sync/server.rs

+4
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,10 @@ impl Server {
363363
continue;
364364
}
365365
Ok(Some(conn)) => Arc::new(conn),
366+
Err(e) if e.kind() == std::io::ErrorKind::Interrupted => {
367+
error!("got interruption {:?}. Continue...", e);
368+
continue;
369+
}
366370
Err(e) => {
367371
error!("listener accept got {:?}", e);
368372
break;

0 commit comments

Comments
 (0)