From da31af6a2c6ba27c8a9b6feca0175f0059269bf1 Mon Sep 17 00:00:00 2001 From: Steven Moreland Date: Sat, 25 Feb 2023 01:55:58 +0000 Subject: libbinder: update RpcState transact comments A few of these have become out of date because - the exponential backoff lambda was moved - server shutdown was added on rpcSend failure Bug: N/A Test: N/A Change-Id: I12b5bef169cf2f2e04ad2f9cd709716d307b7b64 --- libs/binder/RpcState.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'libs/binder/RpcState.cpp') diff --git a/libs/binder/RpcState.cpp b/libs/binder/RpcState.cpp index b27f1028d4..2b0e5bae0d 100644 --- a/libs/binder/RpcState.cpp +++ b/libs/binder/RpcState.cpp @@ -557,13 +557,12 @@ status_t RpcState::transactAddress(const sp& connecti .parcelDataSize = static_cast(data.dataSize()), }; - constexpr size_t kWaitMaxUs = 1000000; - constexpr size_t kWaitLogUs = 10000; - size_t waitUs = 0; - // Oneway calls have no sync point, so if many are sent before, whether this // is a twoway or oneway transaction, they may have filled up the socket. // So, make sure we drain them before polling + constexpr size_t kWaitMaxUs = 1000000; + constexpr size_t kWaitLogUs = 10000; + size_t waitUs = 0; iovec iovs[]{ {&command, sizeof(RpcWireHeader)}, @@ -591,8 +590,9 @@ status_t RpcState::transactAddress(const sp& connecti }, rpcFields->mFds.get()); status != OK) { - // TODO(b/167966510): need to undo onBinderLeaving - we know the - // refcount isn't successfully transferred. + // rpcSend calls shutdownAndWait, so all refcounts should be reset. If we ever tolerate + // errors here, then we may need to undo the binder-sent counts for the transaction as + // well as for the binder objects in the Parcel return status; } -- cgit v1.2.3-59-g8ed1b