libbinder: RPC know when connections setup
Previously, there was a race where:
a. client creates connection to server
b. client sends request for reverse connection to server (but this
may still be traveling on the wire)
c. client sends transaction to server
d. server tries to make a callback
e. server fails to make callback because no reverse connection is setup
Now, when a new connection is setup, a header on this connection is
setup. So, we can wait on this header to be received in (b).
Note: currently, (e) results in an abort, this is tracked in b/167966510
with a TODO in the ExclusiveConnection code. This would make a less
obvious flake (or perhaps the problem would be ignored), but this race
still needs to be fixed for well-behaved clients to be able to function
reliably.
Fixes: 190639665
Test: binderRpcTest (callback test 10,000s of times)
Change-Id: I13bc912692d63ea73d46c5441fa7d51121df2f58
6 files changed