diff options
| author | 2021-07-15 01:41:11 +0000 | |
|---|---|---|
| committer | 2021-07-15 01:41:11 +0000 | |
| commit | 8e6afc0574e121308995f6a19cf4fd9fbee808c6 (patch) | |
| tree | b46899d306992f45e29586ed45a18e4b30fa8882 | |
| parent | e6d7b58981ca14d70dfec1b8b51c2b2f34060de0 (diff) | |
| parent | e96a1f125b4b2130ce61d5e6dc665de928b190e6 (diff) | |
Merge "binder: Increase RPC backlog to 50."
| -rw-r--r-- | libs/binder/RpcServer.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libs/binder/RpcServer.cpp b/libs/binder/RpcServer.cpp index 2a87ae4298..555c5ed72c 100644 --- a/libs/binder/RpcServer.cpp +++ b/libs/binder/RpcServer.cpp @@ -347,7 +347,11 @@ bool RpcServer::setupSocketServer(const RpcSocketAddress& addr) { return false; } - if (0 != TEMP_FAILURE_RETRY(listen(serverFd.get(), 1 /*backlog*/))) { + // Right now, we create all threads at once, making accept4 slow. To avoid hanging the client, + // the backlog is increased to a large number. + // TODO(b/189955605): Once we create threads dynamically & lazily, the backlog can be reduced + // to 1. + if (0 != TEMP_FAILURE_RETRY(listen(serverFd.get(), 50 /*backlog*/))) { int savedErrno = errno; ALOGE("Could not listen socket at %s: %s", addr.toString().c_str(), strerror(savedErrno)); return false; |