Skip to content
Commit 694631ce authored by Paul Hadfield's avatar Paul Hadfield
Browse files

Cancel active Futures/Callbacks if transport dies.

Callers would remain blocked until AndroidFuture or TransportClient-
Callback times out (upto 10mins) in the situation where the Transport
dies during an operation.

This change adds queues for the futures and callbacks that are active.
If they complete normally, they are dequeued. If the TransportConnection
forwards a notification that the transport dies, then all queued active
futures and callbacks are cancelled.

Add a unit test for BackupTransportClient to test the cancellation logic
for futures and callbacks.  This is multithreaded so was tested with
500 iterations to weed out the possibility of race conditions.

BUG: 202716271
Change-Id: I6924c89753f85b9d78a1c6e61518dc1c1e617ef3
Test: atest --iterations 500 BackupTransportClientTest
      atest --iterations 500 TransportStatusCallbackTest
      atest CtsBackupTestCases CtsBackupHostTestCases
      (Gts tests still in progress)
parent 42ce00e9
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment