libbinder: RPC flake mode
Add mode to make flakes more visible, for debugging.
Fixes: 190828148
Test: run w/ binderLibTest and the fuzzer for a bit (no tests
fail - some tests can be made to fail by increasing the delay,
but this is because some of the tests, namely OnewayStressTest,
relies on all operations completing within a certain timeframe)
Change-Id: I3b38ff55ffc56410db585fa02e57ac0271da2b5d
diff --git a/libs/binder/RpcSession.cpp b/libs/binder/RpcSession.cpp
index a759ae3..c1154b8 100644
--- a/libs/binder/RpcSession.cpp
+++ b/libs/binder/RpcSession.cpp
@@ -198,6 +198,8 @@
uint8_t* buffer = reinterpret_cast<uint8_t*>(data);
uint8_t* end = buffer + size;
+ MAYBE_WAIT_IN_FLAKE_MODE;
+
status_t status;
while ((status = triggerablePollRead(fd)) == OK) {
ssize_t readSize = TEMP_FAILURE_RETRY(recv(fd.get(), buffer, end - buffer, MSG_NOSIGNAL));