diff options
author | Dariusz Michaluk <d.michaluk@samsung.com> | 2019-05-14 15:53:58 +0200 |
---|---|---|
committer | Dariusz Michaluk <d.michaluk@samsung.com> | 2019-05-14 15:53:58 +0200 |
commit | f28d202efe7074c3d8334c8e577a55b0191e8810 (patch) | |
tree | 9b399e782e1b6db4b29ff71e49b1d685d258f23f | |
parent | a9844c2ed624b961164fa1e04ee9691c1c43d895 (diff) | |
download | key-manager-f28d202efe7074c3d8334c8e577a55b0191e8810.tar.gz key-manager-f28d202efe7074c3d8334c8e577a55b0191e8810.tar.bz2 key-manager-f28d202efe7074c3d8334c8e577a55b0191e8810.zip |
Increase backlog for listening sockets
When systemd's socket activaction is utilized, the default backlog
parameter passed to the listen() function is set to SOMAXCONN,
which is equal to 128. In distributions where systemd is not used
for socket activation, the default UNIX socket
implementation sets the backlog value to 5.
This may lead to rare overflow of an internal connection queue.
This manifests itself as the -EAGAIN error returned by connect().
To mitigate the issue, the backlog parameter has been set
to SOMAXCONN, which is a default value used by systemd.
Change-Id: I906cd4de478b0dac0eaf860550fccd2f9cd6e184
-rw-r--r-- | src/manager/main/socket-manager.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/manager/main/socket-manager.cpp b/src/manager/main/socket-manager.cpp index f3f6e3f5..07ce31c4 100644 --- a/src/manager/main/socket-manager.cpp +++ b/src/manager/main/socket-manager.cpp @@ -617,7 +617,7 @@ int SocketManager::CreateDomainSocketHelp( umask(originalUmask); - if (-1 == listen(sockfd, 5)) { + if (-1 == listen(sockfd, SOMAXCONN)) { int err = errno; close(sockfd); LogError("Error in listen: " << GetErrnoString(err)); |