diff options
author | Simon Rettberg | 2015-12-17 16:33:22 +0100 |
---|---|---|
committer | Simon Rettberg | 2015-12-17 16:33:22 +0100 |
commit | b47ba01818f2ea2ebd1cf1bf5e3e91e37c5f88dd (patch) | |
tree | 45665ec1c4f69c01438d92b6c5c85edd254ffbab /src/fuse/connection.c | |
parent | [SERVER] Performance: Optimized some functions (gprof) (diff) | |
download | dnbd3-b47ba01818f2ea2ebd1cf1bf5e3e91e37c5f88dd.tar.gz dnbd3-b47ba01818f2ea2ebd1cf1bf5e3e91e37c5f88dd.tar.xz dnbd3-b47ba01818f2ea2ebd1cf1bf5e3e91e37c5f88dd.zip |
[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.
Diffstat (limited to 'src/fuse/connection.c')
-rw-r--r-- | src/fuse/connection.c | 3 |
1 files changed, 3 insertions, 0 deletions
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 ) { |