From b47ba01818f2ea2ebd1cf1bf5e3e91e37c5f88dd Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Thu, 17 Dec 2015 16:33:22 +0100 Subject: [FUSE] Handle SIGINT/SIGTERM to abort pending reads Before, we would wait endlessly if there is a pending read request that doesn't get answered (e.g. because the server went down. That means you couldn't exit the client in that case. Now we use a signal handler to set a flag which causes the read to bail out and return EIO. --- src/fuse/connection.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/fuse/connection.c') diff --git a/src/fuse/connection.c b/src/fuse/connection.c index 0a96055..170e329 100644 --- a/src/fuse/connection.c +++ b/src/fuse/connection.c @@ -215,6 +215,9 @@ bool connection_read(dnbd3_async_t *request) void connection_close() { + if ( keepRunning ) { + logadd( LOG_INFO, "Tearing down dnbd3 connections and workers" ); + } pthread_mutex_lock( &mutexInit ); keepRunning = false; if ( !connectionInitDone ) { -- cgit v1.2.3-55-g7522