summaryrefslogtreecommitdiff
path: root/libs/binder/BpBinder.cpp
diff options
context:
space:
mode:
author Steven Moreland <smoreland@google.com> 2025-01-28 01:02:15 +0000
committer Steven Moreland <smoreland@google.com> 2025-01-28 16:22:03 -0800
commit54fa6c72a903905b388ea8193cd2ffcf5abeb8bf (patch)
treeaf5fc06df9949387b79f0efa361469ff5c0cb044 /libs/binder/BpBinder.cpp
parenta5f7d9f7b8db227c0d72664394513ed58fe38b59 (diff)
RPC Binder: increase transaction size
One of the RPC Binder usecases requires a larger transaction limit. This change increases the limit, and it unifies the 'too large transaction' logging from regular and RPC binder. This hopefully makes it more clear why there is a limit there, we want to keep code compatible between the two transports. A test is added to show the current behavior. When a transaction which is sent is too large, the server closes the session. This is probably the correct behavior for too large replies, but for too large transactions, the client could handle these errors. b/392717039 is filed to investigate inconsistencies raised in the test more deeply. Fixes: 392575419 Test: atest binderRpcTest --test-filter="*LargeVector*" Change-Id: I2eeb08818c10371c7f77a35abee7d4e46bb63d72
Diffstat (limited to 'libs/binder/BpBinder.cpp')
-rw-r--r--libs/binder/BpBinder.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/libs/binder/BpBinder.cpp b/libs/binder/BpBinder.cpp
index 444f06174e..c13e0f9e9c 100644
--- a/libs/binder/BpBinder.cpp
+++ b/libs/binder/BpBinder.cpp
@@ -28,6 +28,7 @@
#include <stdio.h>
#include "BuildFlags.h"
+#include "Constants.h"
#include "file.h"
//#undef ALOGV
@@ -63,9 +64,6 @@ std::atomic<uint32_t> BpBinder::sBinderProxyCountWarned(0);
static constexpr uint32_t kBinderProxyCountWarnInterval = 5000;
-// Log any transactions for which the data exceeds this size
-#define LOG_TRANSACTIONS_OVER_SIZE (300 * 1024)
-
enum {
LIMIT_REACHED_MASK = 0x80000000, // A flag denoting that the limit has been reached
WARNING_REACHED_MASK = 0x40000000, // A flag denoting that the warning has been reached
@@ -403,9 +401,11 @@ status_t BpBinder::transact(
status = IPCThreadState::self()->transact(binderHandle(), code, data, reply, flags);
}
- if (data.dataSize() > LOG_TRANSACTIONS_OVER_SIZE) {
+
+ if (data.dataSize() > binder::kLogTransactionsOverBytes) {
RpcMutexUniqueLock _l(mLock);
- ALOGW("Large outgoing transaction of %zu bytes, interface descriptor %s, code %d",
+ ALOGW("Large outgoing transaction of %zu bytes, interface descriptor %s, code %d was "
+ "sent",
data.dataSize(), String8(mDescriptorCache).c_str(), code);
}