aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/lib/nfs/Connection.cxx18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/lib/nfs/Connection.cxx b/src/lib/nfs/Connection.cxx
index 64458fec6..d37817a86 100644
--- a/src/lib/nfs/Connection.cxx
+++ b/src/lib/nfs/Connection.cxx
@@ -300,6 +300,24 @@ NfsConnection::OnSocketReady(unsigned flags)
closed = true;
BroadcastError(std::move(error));
+ } else if (SocketMonitor::IsDefined() && nfs_get_fd(context) < 0) {
+ /* this happens when rpc_reconnect_requeue() is called
+ after the connection broke, but autoreconnet was
+ disabled - nfs_service() returns 0 */
+ Error error;
+ const char *msg = nfs_get_error(context);
+ if (msg == nullptr)
+ error.Set(nfs_domain, "NFS socket disappeared");
+ else
+ error.Format(nfs_domain,
+ "NFS socket disappeared: %s", msg);
+
+ const ScopeLock protect(mutex);
+
+ DestroyContext();
+ closed = true;
+
+ BroadcastError(std::move(error));
}
assert(in_event);