nfs/Connection: check for disappearing libnfs socket
This commit is contained in:
parent
6d643f92b7
commit
43da1686da
@ -299,6 +299,24 @@ NfsConnection::OnSocketReady(unsigned flags)
|
||||
DestroyContext();
|
||||
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));
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user