From 42d3c3b4b2943f24cc9792350a391b273cd19686 Mon Sep 17 00:00:00 2001 From: mwojcik Date: Tue, 27 Feb 2024 16:52:36 +0800 Subject: [PATCH] session: workaround for stream.close interrupted --- artiq/firmware/runtime/session.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/artiq/firmware/runtime/session.rs b/artiq/firmware/runtime/session.rs index 8c1a7aaee..52daaa2d0 100644 --- a/artiq/firmware/runtime/session.rs +++ b/artiq/firmware/runtime/session.rs @@ -976,7 +976,13 @@ pub fn thread(io: Io, aux_mutex: &Mutex, drtio::clear_buffers(&io, &aux_mutex); } } - stream.close().expect("session: close socket"); + loop { + match stream.close() { + Ok(_) => break, + Err(SchedError::Interrupted) => (), + Err(e) => panic!("session: close socket: {:?}", e) + }; + } }); }