Skip to content

Commit 2330e9b

Browse files
author
Tej Singh
committed
Retry pullfinish with empty payload if call fails
If the first call for pullFinished fails, it is likely because the transaction is too large. Currently, if this happens statsd will just sleep until the timeout. With this change, the client will retry calling pullFinish if the first attempt fails, but with an empty payload (and with success = false) to cause the puller to fail fast, and so statsd does not wait for the timeout. Test: atest GtsStatsdHostTestCases Bug: 157768117 Change-Id: I1af29b6c83039ab56ef847832a600d4afea34000
1 parent d7b08c7 commit 2330e9b

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

apex/statsd/framework/java/android/app/StatsManager.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,15 @@ public void onPullAtom(int atomTag, IPullAtomResultReceiver resultReceiver) {
561561
try {
562562
resultReceiver.pullFinished(atomTag, success, parcels);
563563
} catch (RemoteException e) {
564-
Log.w(TAG, "StatsPullResultReceiver failed for tag " + mAtomId);
564+
Log.w(TAG, "StatsPullResultReceiver failed for tag " + mAtomId
565+
+ " due to TransactionTooLarge. Calling pullFinish with no data");
566+
StatsEventParcel[] emptyData = new StatsEventParcel[0];
567+
try {
568+
resultReceiver.pullFinished(atomTag, /*success=*/false, emptyData);
569+
} catch (RemoteException nestedException) {
570+
Log.w(TAG, "StatsPullResultReceiver failed for tag " + mAtomId
571+
+ " with empty payload");
572+
}
565573
}
566574
});
567575
} finally {

0 commit comments

Comments
 (0)