Skip to content

Commit

Permalink
Handle OS interruptions
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
jsturtevant committed Dec 12, 2023
1 parent 6fe7d39 commit 693f4c5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/sync/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 693f4c5

Please sign in to comment.