libvirt/src/libvirt_remote.syms
Michal Privoznik f3ab818984 rpc: Temporarily stop accept()-ing new clients on EMFILE
This commit is related to 5de203f879 which I pushed a few days
ago. While that commit prioritized closing clients socket over
the rest of I/O process, this one goes one step further and
temporarily suspends processing new connection requests.

A brief recapitulation of the problem:

1) assume that libvirt is at the top of RLIMIT_NOFILE (that is no
   new FDs can be opened).

2) we have a client trying to connect to a UNIX/TCP socket

Because of 2) our event loop sees POLLIN on the socket and thus
calls virNetServerServiceAccept(). But since no new FDs can be
opened (because of 1)) the request is not handled and we will get
the same event on next iteration. The poll() will exit
immediately because there is an event on the socket.  Thus we end
up in an endless loop.

To break the loop and stop burning CPU cycles we can stop
listening for events on the socket and set up a timer tho enable
listening again after some time (I chose 5 seconds because of no
obvious reason).

There's another area where we play with temporarily suspending
accept() of new clients - when a client disconnects and we check
max_clients against number of current clients. Problem here is
that max_clients can be orders of magnitude larger than
RLIMIT_NOFILE but more importantly, what this code considers
client disconnect is not equal to closing client's FD.
A client disconnecting means that the corresponding client
structure is removed from the internal list of clients. Closing
of the client's FD is done from event loop - asynchronously.

To avoid this part stepping on the toes of my fix, let's make the
code NOP if socket timer (as described above) is active.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2021-10-20 16:25:22 +02:00

290 lines
7.3 KiB
Plaintext

#
# Private symbols used in RPC operations. Add symbols here, and see
# src/remote/meson.build for more details.
#
# Keep this file sorted by header name, then by symbols with each header.
#
# Generated files
xdr_*;
# Hack only required for Win32 to make tests link properly,
# as the wildcard above doesn't work there. Fortunately
# Win32 builds don't require the other xdr_* syms exported.
# since there's no libvirtd built.
xdr_virNetMessageError;
# remote/remote_sockets.h
remoteProbeSessionDriverFromBinary;
remoteProbeSessionDriverFromSocket;
remoteProbeSystemDriverFromSocket;
# rpc/virnetclient.h
virNetClientAddProgram;
virNetClientAddStream;
virNetClientClose;
virNetClientDupFD;
virNetClientGetFD;
virNetClientGetTLSKeySize;
virNetClientHasPassFD;
virNetClientIsEncrypted;
virNetClientIsOpen;
virNetClientKeepAliveIsSupported;
virNetClientKeepAliveStart;
virNetClientKeepAliveStop;
virNetClientLocalAddrStringSASL;
virNetClientNewExternal;
virNetClientNewLibSSH2;
virNetClientNewSSH;
virNetClientNewTCP;
virNetClientNewUNIX;
virNetClientRegisterAsyncIO;
virNetClientRegisterKeepAlive;
virNetClientRemoteAddrStringSASL;
virNetClientRemoveStream;
virNetClientSendNonBlock;
virNetClientSendStream;
virNetClientSendWithReply;
virNetClientSetCloseCallback;
virNetClientSetTLSSession;
virNetClientSSHHelperCommand;
# rpc/virnetclientprogram.h
virNetClientProgramCall;
virNetClientProgramDispatch;
virNetClientProgramGetProgram;
virNetClientProgramGetVersion;
virNetClientProgramMatches;
virNetClientProgramNew;
# rpc/virnetclientstream.h
virNetClientStreamCheckSendStatus;
virNetClientStreamCheckState;
virNetClientStreamEOF;
virNetClientStreamEventAddCallback;
virNetClientStreamEventRemoveCallback;
virNetClientStreamEventUpdateCallback;
virNetClientStreamMatches;
virNetClientStreamNew;
virNetClientStreamQueuePacket;
virNetClientStreamRecvHole;
virNetClientStreamRecvPacket;
virNetClientStreamSendHole;
virNetClientStreamSendPacket;
virNetClientStreamSetError;
# rpc/virnetdaemon.h
virNetDaemonAddServer;
virNetDaemonAddShutdownInhibition;
virNetDaemonAddSignalHandler;
virNetDaemonAutoShutdown;
virNetDaemonGetServer;
virNetDaemonGetServers;
virNetDaemonHasClients;
virNetDaemonHasServer;
virNetDaemonIsPrivileged;
virNetDaemonNew;
virNetDaemonNewPostExecRestart;
virNetDaemonPreExecRestart;
virNetDaemonQuit;
virNetDaemonQuitExecRestart;
virNetDaemonRemoveShutdownInhibition;
virNetDaemonRun;
virNetDaemonSetShutdownCallbacks;
virNetDaemonSetStateStopWorkerThread;
virNetDaemonUpdateServices;
# rpc/virnetmessage.h
virNetMessageAddFD;
virNetMessageClear;
virNetMessageClearPayload;
virNetMessageDecodeHeader;
virNetMessageDecodeLength;
virNetMessageDecodeNumFDs;
virNetMessageDecodePayload;
virNetMessageDupFD;
virNetMessageEncodeHeader;
virNetMessageEncodeNumFDs;
virNetMessageEncodePayload;
virNetMessageEncodePayloadRaw;
virNetMessageFree;
virNetMessageNew;
virNetMessageQueuePush;
virNetMessageQueueServe;
virNetMessageSaveError;
# rpc/virnetserver.h
virNetServerAddClient;
virNetServerAddProgram;
virNetServerAddService;
virNetServerAddServiceTCP;
virNetServerAddServiceUNIX;
virNetServerClose;
virNetServerGetClient;
virNetServerGetClients;
virNetServerGetCurrentClients;
virNetServerGetCurrentUnauthClients;
virNetServerGetMaxClients;
virNetServerGetMaxUnauthClients;
virNetServerGetName;
virNetServerGetThreadPoolParameters;
virNetServerHasClients;
virNetServerNeedsAuth;
virNetServerNew;
virNetServerNewPostExecRestart;
virNetServerNextClientID;
virNetServerPreExecRestart;
virNetServerProcessClients;
virNetServerSetClientAuthenticated;
virNetServerSetClientLimits;
virNetServerSetThreadPoolParameters;
virNetServerSetTLSContext;
virNetServerUpdateServices;
virNetServerUpdateTlsFiles;
# rpc/virnetserverclient.h
virNetServerClientAddFilter;
virNetServerClientClose;
virNetServerClientCloseLocked;
virNetServerClientDelayedClose;
virNetServerClientGetAuth;
virNetServerClientGetFD;
virNetServerClientGetID;
virNetServerClientGetIdentity;
virNetServerClientGetInfo;
virNetServerClientGetPrivateData;
virNetServerClientGetReadonly;
virNetServerClientGetSELinuxContext;
virNetServerClientGetTimestamp;
virNetServerClientGetTLSKeySize;
virNetServerClientGetTLSSession;
virNetServerClientGetTransport;
virNetServerClientGetUNIXIdentity;
virNetServerClientHasTLSSession;
virNetServerClientImmediateClose;
virNetServerClientInit;
virNetServerClientInitKeepAlive;
virNetServerClientIsAuthenticated;
virNetServerClientIsAuthPendingLocked;
virNetServerClientIsClosedLocked;
virNetServerClientIsLocal;
virNetServerClientIsSecure;
virNetServerClientLocalAddrStringSASL;
virNetServerClientNew;
virNetServerClientNewPostExecRestart;
virNetServerClientPreExecRestart;
virNetServerClientRemoteAddrStringSASL;
virNetServerClientRemoteAddrStringURI;
virNetServerClientRemoveFilter;
virNetServerClientSendMessage;
virNetServerClientSetAuthLocked;
virNetServerClientSetAuthPendingLocked;
virNetServerClientSetCloseHook;
virNetServerClientSetDispatcher;
virNetServerClientSetIdentity;
virNetServerClientSetQuietEOF;
virNetServerClientSetReadonly;
virNetServerClientStartKeepAlive;
virNetServerClientWantCloseLocked;
# rpc/virnetserverprogram.h
virNetServerProgramDispatch;
virNetServerProgramGetID;
virNetServerProgramGetPriority;
virNetServerProgramGetVersion;
virNetServerProgramMatches;
virNetServerProgramNew;
virNetServerProgramSendReplyError;
virNetServerProgramSendStreamData;
virNetServerProgramSendStreamError;
virNetServerProgramSendStreamHole;
virNetServerProgramUnknownError;
# rpc/virnetserverservice.h
virNetServerServiceClose;
virNetServerServiceGetAuth;
virNetServerServiceGetMaxRequests;
virNetServerServiceGetPort;
virNetServerServiceGetTLSContext;
virNetServerServiceIsReadonly;
virNetServerServiceNewFDs;
virNetServerServiceNewPostExecRestart;
virNetServerServiceNewTCP;
virNetServerServiceNewUNIX;
virNetServerServicePreExecRestart;
virNetServerServiceSetDispatcher;
virNetServerServiceTimerActive;
virNetServerServiceToggle;
# rpc/virnetsocket.h
virNetSocketAccept;
virNetSocketAddIOCallback;
virNetSocketCheckProtocols;
virNetSocketClose;
virNetSocketDupFD;
virNetSocketGetFD;
virNetSocketGetPath;
virNetSocketGetPort;
virNetSocketGetSELinuxContext;
virNetSocketGetUNIXIdentity;
virNetSocketHasCachedData;
virNetSocketHasPassFD;
virNetSocketHasPendingData;
virNetSocketIsLocal;
virNetSocketListen;
virNetSocketLocalAddrStringSASL;
virNetSocketNewConnectCommand;
virNetSocketNewConnectExternal;
virNetSocketNewConnectLibSSH2;
virNetSocketNewConnectSockFD;
virNetSocketNewConnectSSH;
virNetSocketNewConnectTCP;
virNetSocketNewConnectUNIX;
virNetSocketNewListenFD;
virNetSocketNewListenTCP;
virNetSocketNewListenUNIX;
virNetSocketNewPostExecRestart;
virNetSocketPreExecRestart;
virNetSocketRead;
virNetSocketRecvFD;
virNetSocketRemoteAddrStringSASL;
virNetSocketRemoteAddrStringURI;
virNetSocketRemoveIOCallback;
virNetSocketSendFD;
virNetSocketSetBlocking;
virNetSocketSetTLSSession;
virNetSocketUpdateIOCallback;
virNetSocketWrite;
# rpc/virnettlscontext.h
virNetTLSContextCheckCertificate;
virNetTLSContextNewClient;
virNetTLSContextNewClientPath;
virNetTLSContextNewServer;
virNetTLSContextNewServerPath;
virNetTLSInit;
virNetTLSSessionGetHandshakeStatus;
virNetTLSSessionGetKeySize;
virNetTLSSessionGetX509DName;
virNetTLSSessionHandshake;
virNetTLSSessionNew;
virNetTLSSessionRead;
virNetTLSSessionSetIOCallbacks;
virNetTLSSessionWrite;
# Let emacs know we want case-insensitive sorting
# Local Variables:
# sort-fold-case: t
# End: