diff options
author | 2021-06-03 00:59:28 +0000 | |
---|---|---|
committer | 2021-06-03 01:04:36 +0000 | |
commit | 52eee940ed5cf15eb9f6839697367d5cad847118 (patch) | |
tree | cf37ce6b1a2333e2ec8f7564ee94b441138f7295 /libs/binder/RpcSession.cpp | |
parent | e54384bbd4d4c3b433b180e8f25c15266ae21228 (diff) |
libbinder: RPC prevent oneway cmd buildup
Previously, binderRpcTest OnewayStressTest was having a flaky hang @ 100
calls because the sockets were filling up with decref counts (these are
currently a bit long because they contain RpcAddress - these may need to
be smaller - see b/182939933). I temporarily reduced this to 50 calls to
avoid the flake, but this is the real fix (which also increases the
number of calls to 500).
Now, when we send a oneway call, we also drain any refcounts ("CONTROL")
commands. We disallow processing of any transactions in this case (this
would indicate a misbehaving client).
Fixes: 189272263
Test: binderRpcTest
Change-Id: If92af65f5e5a920e39046af6b10f675b5c26cd6e
Diffstat (limited to 'libs/binder/RpcSession.cpp')
-rw-r--r-- | libs/binder/RpcSession.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libs/binder/RpcSession.cpp b/libs/binder/RpcSession.cpp index a3efa56e3b..a2fe3b91ba 100644 --- a/libs/binder/RpcSession.cpp +++ b/libs/binder/RpcSession.cpp @@ -237,7 +237,8 @@ void RpcSession::join(sp<RpcSession>&& session, unique_fd client) { sp<RpcConnection> connection = session->assignServerToThisThread(std::move(client)); while (true) { - status_t error = session->state()->getAndExecuteCommand(connection->fd, session); + status_t error = session->state()->getAndExecuteCommand(connection->fd, session, + RpcState::CommandType::ANY); if (error != OK) { LOG_RPC_DETAIL("Binder connection thread closing w/ status %s", |