Skip to content

Retry topic subscription on quota errors using exponential backoff #6098

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jul 30, 2024

Conversation

welishr
Copy link
Contributor

@welishr welishr commented Jul 12, 2024

Topic subscription requests might hit a quota, but we can retry these failures with exponential backoff incase they are transient

Fixes #6032

@welishr welishr requested a review from gsakakihara July 12, 2024 19:35
Copy link
Contributor

github-actions bot commented Jul 12, 2024

Release note changes

The following release notes were modified. Please ensure they look correct.

Release Notes
firebase-messaging
### {{messaging_longer}} version 24.0.1 {: #messaging_v24-0-1}

* {{changed}} Retry Topic Subscribe/Unsubscribe operations with exponential
  backoff if they hit a quota error.

#### {{messaging_longer}} Kotlin extensions version 24.0.1 {: #messaging-ktx_v24-0-1}

The Kotlin extensions library transitively includes the updated
`firebase-messaging` library. The Kotlin extensions library has no additional
updates.

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Jul 12, 2024

Size Report 1

Affected Products

  • firebase-messaging

    TypeBase (4db5dc8)Merge (b8c0269)Diff
    aar148 kB148 kB+53 B (+0.0%)
    apk (aggressive)578 kB578 kB+48 B (+0.0%)
    apk (release)5.30 MB5.30 MB+76 B (+0.0%)

Test Logs

  1. https://storage.googleapis.com/firebase-sdk-metric-reports/zqutsoUFPb.html

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Jul 12, 2024

Coverage Report 1

Affected Products

  • firebase-messaging

    Overall coverage changed from 84.07% (26c8a5a) to 84.30% (36675a5) by +0.23%.

    FilenameBase (26c8a5a)Merge (36675a5)Diff
    FirebaseMessaging.java76.40%76.80%+0.40%
    Metadata.java36.51%41.27%+4.76%
    RequestDeduplicator.java80.00%90.00%+10.00%
    TopicsSubscriber.java88.60%88.70%+0.10%

Test Logs

  1. https://storage.googleapis.com/firebase-sdk-metric-reports/Ori0aw4PhV.html

Copy link
Contributor

github-actions bot commented Jul 12, 2024

Unit Test Results

  64 files  +  56    64 suites  +56   6m 10s ⏱️ + 5m 45s
486 tests +464  486 ✔️ +464  0 💤 ±0  0 ±0 
978 runs  +934  978 ✔️ +934  0 💤 ±0  0 ±0 

Results for commit e8336b8. ± Comparison against base commit 26c8a5a.

This pull request removes 22 and adds 486 tests. Note that renamed tests count towards both.
com.google.firebase.crashlytics.internal.common.CrashlyticsControllerRobolectricTest ‑ testDoCloseSession_disabledAnrs_doesNotPersistsAppExitInfo
com.google.firebase.crashlytics.internal.common.CrashlyticsControllerRobolectricTest ‑ testDoCloseSession_enabledAnrs_doesNotPersistsAppExitInfoIfItDoesntExist
com.google.firebase.crashlytics.internal.common.CrashlyticsControllerRobolectricTest ‑ testDoCloseSession_enabledAnrs_persistsAppExitInfoIfItExists
com.google.firebase.crashlytics.internal.common.DataCollectionArbiterRobolectricTest ‑ testDefaultDataCollection_usedWhenNoOverrideOrManifestSetting
com.google.firebase.crashlytics.internal.common.DataCollectionArbiterRobolectricTest ‑ testManifestMetadata_respectedWhenNoOverride
com.google.firebase.crashlytics.internal.common.DataCollectionArbiterRobolectricTest ‑ testSetCrashlyticsDataCollectionEnabled_overridesOtherSettings
com.google.firebase.crashlytics.internal.common.SessionReportingCoordinatorRobolectricTest ‑ testAppExitInfoEvent_notPersistIfAnrBeforeSession
com.google.firebase.crashlytics.internal.common.SessionReportingCoordinatorRobolectricTest ‑ testAppExitInfoEvent_notPersistIfAppExitInfoNotAnrButWithinSession
com.google.firebase.crashlytics.internal.common.SessionReportingCoordinatorRobolectricTest ‑ testAppExitInfoEvent_persistIfAnrWithinSession
com.google.firebase.crashlytics.internal.common.SessionReportingCoordinatorRobolectricTest ‑ testAppExitInfoEvent_persistIfAnrWithinSession_multipleAppExitInfo
…
com.google.firebase.iid.FirebaseInstanceIdWithFcmReceiverRoboTest ‑ testNoWrappedIntent
com.google.firebase.iid.FirebaseInstanceIdWithFcmReceiverRoboTest ‑ testNullIntent
com.google.firebase.iid.FirebaseInstanceIdWithFcmReceiverRoboTest ‑ testStartsService_notOButTargetingO
com.google.firebase.iid.FirebaseInstanceIdWithFcmReceiverRoboTest ‑ testStartsService_notOButTargetingO[21]
com.google.firebase.iid.FirebaseInstanceIdWithFcmReceiverRoboTest ‑ testStartsService_notOButTargetingO[22]
com.google.firebase.iid.FirebaseInstanceIdWithFcmReceiverRoboTest ‑ testStartsService_notOButTargetingO[23]
com.google.firebase.iid.FirebaseInstanceIdWithFcmReceiverRoboTest ‑ testStartsService_notOButTargetingO[24]
com.google.firebase.iid.FirebaseInstanceIdWithFcmReceiverRoboTest ‑ testStartsService_preO
com.google.firebase.iid.FirebaseInstanceIdWithFcmReceiverRoboTest ‑ testStartsService_preO[21]
com.google.firebase.iid.FirebaseInstanceIdWithFcmReceiverRoboTest ‑ testStartsService_preO[22]
…

♻️ This comment has been updated with latest results.

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Jul 12, 2024

Startup Time Report 1

Note: Layout is sometimes suboptimal due to limited formatting support on GitHub. Please check this report on GCS.

Notes

Startup Times

  • fire-fcm

    DeviceStatisticsDistributions
    oriole-32
    Percentile26c8a5a36675a5DiffSignificant (?)
    p101.47 ±1 ms1.14 ±1 ms-330 μs (-22.5%)NO
    p251.55 ±1 ms1.22 ±1 ms-335 μs (-21.5%)NO
    p501.69 ±1 ms1.33 ±1 ms-359 μs (-21.2%)NO
    p751.98 ±1 ms1.52 ±1 ms-458 μs (-23.1%)NO
    p902.25 ±2 ms1.80 ±2 ms-449 μs (-20.0%)NO

    20 test runs in comparison
    CommitTest Runs
    26c8a5a
    • 2024-07-29_19:02:37.579021_LYYa
    • 2024-07-29_19:02:37.579068_hvRK
    • 2024-07-29_19:02:37.579079_uGrE
    • 2024-07-29_19:02:37.579087_xwpo
    • 2024-07-29_19:02:37.579095_cEWs
    • 2024-07-29_19:02:37.579103_ItNA
    • 2024-07-29_19:02:37.579110_IysS
    • 2024-07-29_19:02:37.579116_Puqu
    • 2024-07-29_19:02:37.579124_NxGQ
    • 2024-07-29_19:02:37.579130_AjPt
    36675a5
    • 2024-07-29_21:30:29.583604_mPQQ
    • 2024-07-29_21:30:29.583642_brjh
    • 2024-07-29_21:30:29.583653_RmFK
    • 2024-07-29_21:30:29.583661_Jnlg
    • 2024-07-29_21:30:29.583668_DLMB
    • 2024-07-29_21:30:29.583676_JnBo
    • 2024-07-29_21:30:29.583683_NmTI
    • 2024-07-29_21:30:29.583690_bhAX
    • 2024-07-29_21:30:29.583697_hplz
    • 2024-07-29_21:30:29.583704_LOnr
    redfin-30
    Percentile26c8a5a36675a5DiffSignificant (?)
    p101.49 ±1 ms1.27 ±0.4 ms-221 μs (-14.9%)NO
    p251.69 ±1 ms1.34 ±0.4 ms-349 μs (-20.7%)NO
    p502.04 ±2 ms1.48 ±0.5 ms-559 μs (-27.5%)NO
    p752.49 ±2 ms1.77 ±0.6 ms-726 μs (-29.1%)NO
    p903.08 ±3 ms2.37 ±1 ms-703 μs (-22.9%)NO

    20 test runs in comparison
    CommitTest Runs
    26c8a5a
    • 2024-07-29_19:02:37.579021_LYYa
    • 2024-07-29_19:02:37.579068_hvRK
    • 2024-07-29_19:02:37.579079_uGrE
    • 2024-07-29_19:02:37.579087_xwpo
    • 2024-07-29_19:02:37.579095_cEWs
    • 2024-07-29_19:02:37.579103_ItNA
    • 2024-07-29_19:02:37.579110_IysS
    • 2024-07-29_19:02:37.579116_Puqu
    • 2024-07-29_19:02:37.579124_NxGQ
    • 2024-07-29_19:02:37.579130_AjPt
    36675a5
    • 2024-07-29_21:30:29.583604_mPQQ
    • 2024-07-29_21:30:29.583642_brjh
    • 2024-07-29_21:30:29.583653_RmFK
    • 2024-07-29_21:30:29.583661_Jnlg
    • 2024-07-29_21:30:29.583668_DLMB
    • 2024-07-29_21:30:29.583676_JnBo
    • 2024-07-29_21:30:29.583683_NmTI
    • 2024-07-29_21:30:29.583690_bhAX
    • 2024-07-29_21:30:29.583697_hplz
    • 2024-07-29_21:30:29.583704_LOnr
  • timeToInitialDisplay

    DeviceStatisticsDistributions
    oriole-32
    Percentile26c8a5a36675a5DiffSignificant (?)
    p10202 ±5 ms208 ±5 ms+5.56 ms (+2.7%)NO
    p25208 ±5 ms214 ±6 ms+6.23 ms (+3.0%)NO
    p50215 ±7 ms222 ±7 ms+6.61 ms (+3.1%)NO
    p75225 ±12 ms231 ±8 ms+6.67 ms (+3.0%)NO
    p90235 ±20 ms248 ±14 ms+12.7 ms (+5.4%)NO

    20 test runs in comparison
    CommitTest Runs
    26c8a5a
    • 2024-07-29_19:02:37.579021_LYYa
    • 2024-07-29_19:02:37.579068_hvRK
    • 2024-07-29_19:02:37.579079_uGrE
    • 2024-07-29_19:02:37.579087_xwpo
    • 2024-07-29_19:02:37.579095_cEWs
    • 2024-07-29_19:02:37.579103_ItNA
    • 2024-07-29_19:02:37.579110_IysS
    • 2024-07-29_19:02:37.579116_Puqu
    • 2024-07-29_19:02:37.579124_NxGQ
    • 2024-07-29_19:02:37.579130_AjPt
    36675a5
    • 2024-07-29_21:30:29.583604_mPQQ
    • 2024-07-29_21:30:29.583642_brjh
    • 2024-07-29_21:30:29.583653_RmFK
    • 2024-07-29_21:30:29.583661_Jnlg
    • 2024-07-29_21:30:29.583668_DLMB
    • 2024-07-29_21:30:29.583676_JnBo
    • 2024-07-29_21:30:29.583683_NmTI
    • 2024-07-29_21:30:29.583690_bhAX
    • 2024-07-29_21:30:29.583697_hplz
    • 2024-07-29_21:30:29.583704_LOnr
    redfin-30
    Percentile26c8a5a36675a5DiffSignificant (?)
    p10242 ±3 ms265 ±6 ms+22.7 ms (+9.4%)MAYBE
    p25248 ±3 ms271 ±5 ms+23.0 ms (+9.3%)MAYBE
    p50254 ±3 ms279 ±5 ms+24.5 ms (+9.6%)YES
    p75260 ±4 ms289 ±7 ms+28.6 ms (+11.0%)MAYBE
    p90269 ±7 ms305 ±7 ms+35.9 ms (+13.3%)YES

    20 test runs in comparison
    CommitTest Runs
    26c8a5a
    • 2024-07-29_19:02:37.579021_LYYa
    • 2024-07-29_19:02:37.579068_hvRK
    • 2024-07-29_19:02:37.579079_uGrE
    • 2024-07-29_19:02:37.579087_xwpo
    • 2024-07-29_19:02:37.579095_cEWs
    • 2024-07-29_19:02:37.579103_ItNA
    • 2024-07-29_19:02:37.579110_IysS
    • 2024-07-29_19:02:37.579116_Puqu
    • 2024-07-29_19:02:37.579124_NxGQ
    • 2024-07-29_19:02:37.579130_AjPt
    36675a5
    • 2024-07-29_21:30:29.583604_mPQQ
    • 2024-07-29_21:30:29.583642_brjh
    • 2024-07-29_21:30:29.583653_RmFK
    • 2024-07-29_21:30:29.583661_Jnlg
    • 2024-07-29_21:30:29.583668_DLMB
    • 2024-07-29_21:30:29.583676_JnBo
    • 2024-07-29_21:30:29.583683_NmTI
    • 2024-07-29_21:30:29.583690_bhAX
    • 2024-07-29_21:30:29.583697_hplz
    • 2024-07-29_21:30:29.583704_LOnr

  1. https://storage.googleapis.com/firebase-sdk-metric-reports/8jTuVb6cG2/index.html

@welishr welishr merged commit c928402 into main Jul 30, 2024
36 checks passed
@welishr welishr deleted the fie-quota-retry branch July 30, 2024 16:08
@firebase firebase locked and limited conversation to collaborators Aug 30, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Topic Operation fails with "Failed to sync topics. Won't retry sync. TOO_MANY_SUBSCRIBERS" and won't callback
3 participants