Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 427e27ad authored by Steven Moreland's avatar Steven Moreland
Browse files

RPC Binder: log unexpected transport errors

Frederick saw ENOMEM here sometimes, so make sure
we are covered. We do not log common/expected logs.

Bug: 419364025
Bug: 419074122
Test: binderRpcTest (adds no additional logs)
Change-Id: If6b38b44c3c9f05a626123e4e130d8dde5f887c7
parent 37d9d0aa
Loading
Loading
Loading
Loading
+14 −4
Original line number Diff line number Diff line
@@ -389,8 +389,13 @@ status_t RpcState::rpcSend(const sp<RpcSession::RpcConnection>& connection,
                                                                  iovs, niovs, altPoll,
                                                                  ancillaryFds);
        status != OK) {
        LOG_RPC_DETAIL("Failed to write %s (%d iovs) on RpcTransport %p, error: %s", what, niovs,
        if (status == DEAD_OBJECT || status == -ECONNRESET) {
            LOG_RPC_DETAIL("Failed to write %s (%d iovs) on RpcTransport %p, error: %s", what,
                           niovs, connection->rpcTransport.get(), statusToString(status).c_str());
        } else {
            ALOGE("Failed to write %s (%d iovs) on RpcTransport %p, error: %s", what, niovs,
                  connection->rpcTransport.get(), statusToString(status).c_str());
        }
        (void)session->shutdownAndWait(false);
        return status;
    }
@@ -407,8 +412,13 @@ status_t RpcState::rpcRec(const sp<RpcSession::RpcConnection>& connection,
                                                                 iovs, niovs, std::nullopt,
                                                                 ancillaryFds);
        status != OK) {
        if (status == DEAD_OBJECT || status == -ECONNRESET) {
            LOG_RPC_DETAIL("Failed to read %s (%d iovs) on RpcTransport %p, error: %s", what, niovs,
                           connection->rpcTransport.get(), statusToString(status).c_str());
        } else {
            ALOGE("Failed to read %s (%d iovs) on RpcTransport %p, error: %s", what, niovs,
                  connection->rpcTransport.get(), statusToString(status).c_str());
        }
        (void)session->shutdownAndWait(false);
        return status;
    }