-
Notifications
You must be signed in to change notification settings - Fork 487
Remove Cache Clearing to reduce CDN load on failing devices (EXPOSUREAPP-2405) #1108
Remove Cache Clearing to reduce CDN load on failing devices (EXPOSUREAPP-2405) #1108
Conversation
…ally needs to be accompanied by a way to clear the cache manually and a way to identify more root causes of Transaction Failures. Signed-off-by: d067928 <[email protected]>
…-on-key-retrieval-failure
Only Remove Files from Cache that failed to download, instead of every file. This is accompanied ideally by no rollback in the Key Retrieval. We only delete the cache ref, the file will not be deleted as it is considered not present Signed-off-by: d067928 <[email protected]>
823d29d to
1c00161
Compare
d4rken
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Multithreading 😰
Corona-Warn-App/src/main/java/de/rki/coronawarnapp/storage/LocalData.kt
Outdated
Show resolved
Hide resolved
Corona-Warn-App/src/main/java/de/rki/coronawarnapp/storage/LocalData.kt
Outdated
Show resolved
Hide resolved
...-Warn-App/src/main/java/de/rki/coronawarnapp/transaction/RetrieveDiagnosisKeysTransaction.kt
Outdated
Show resolved
Hide resolved
Corona-Warn-App/src/main/java/de/rki/coronawarnapp/util/CachedKeyFileHolder.kt
Outdated
Show resolved
Hide resolved
Corona-Warn-App/src/main/java/de/rki/coronawarnapp/util/CachedKeyFileHolder.kt
Outdated
Show resolved
Hide resolved
|
Too many open points, doing another approach with proper testing and reopening. |
Signed-off-by: d067928 <[email protected]>
Signed-off-by: d067928 <[email protected]>
Signed-off-by: d067928 <[email protected]>
Signed-off-by: d067928 <[email protected]>
harambasicluka
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
strings.xml look good.
| private const val QUOTA_RESET_PERIOD_IN_HOURS = 24 | ||
|
|
||
| private val quotaCalculator: QuotaCalculator<Int> = GoogleQuotaCalculator( | ||
| incrementByAmount = 14, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it still increment count by 14 each time executeAPISubmission is called? I thought that after #1088 it should increment it only by 1, as provideDiagnosisKeys is called once. Assuming that Google docs are correct:
Calls to this method are limited to six per day for token=TOKEN_A and 20 per day when token != TOKEN_A (Allowlisted accounts are allowed 1,000,000 calls per day.)
This quota applies per call, not per file or batch of files uploaded. In other words, a single call with multiple files or multiple batches counts as only one call. Days are defined as midnight to midnight of a device's UTC.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will be done in a separate PR as we plan to provide this change here before 1.4 official release. this way we single out the commit. But you are correct, with the changes in v1.5 mode, this needs to be set to 1
P.S.: I also already included a test case for this change. I hope to do a one-liner correction.
Corona-Warn-App/src/main/java/de/rki/coronawarnapp/storage/LocalData.kt
Outdated
Show resolved
Hide resolved
Corona-Warn-App/src/main/java/de/rki/coronawarnapp/storage/LocalData.kt
Outdated
Show resolved
Hide resolved
Corona-Warn-App/src/main/java/de/rki/coronawarnapp/storage/LocalData.kt
Outdated
Show resolved
Hide resolved
Corona-Warn-App/src/main/java/de/rki/coronawarnapp/storage/LocalData.kt
Outdated
Show resolved
Hide resolved
...-Warn-App/src/main/java/de/rki/coronawarnapp/transaction/RetrieveDiagnosisKeysTransaction.kt
Outdated
Show resolved
Hide resolved
Corona-Warn-App/src/main/java/de/rki/coronawarnapp/util/GoogleQuotaCalculator.kt
Show resolved
Hide resolved
Corona-Warn-App/src/main/java/de/rki/coronawarnapp/util/GoogleQuotaCalculator.kt
Outdated
Show resolved
Hide resolved
Corona-Warn-App/src/main/java/de/rki/coronawarnapp/util/QuotaCalculator.kt
Outdated
Show resolved
Hide resolved
Signed-off-by: d067928 <[email protected]>
…trieval-failure' into fix/do-not-clear-cache-on-key-retrieval-failure
|
Kudos, SonarCloud Quality Gate passed!
|
d4rken
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
…APP-2405) (#1108) * Remove Cache Clearing to reduce CDN load on failing devices. This ideally needs to be accompanied by a way to clear the cache manually and a way to identify more root causes of Transaction Failures. Signed-off-by: d067928 <[email protected]> * Remove Files that failed for Key Retrieval Only Remove Files from Cache that failed to download, instead of every file. This is accompanied ideally by no rollback in the Key Retrieval. We only delete the cache ref, the file will not be deleted as it is considered not present Signed-off-by: d067928 <[email protected]> * Introduce dedicated QuotaCalculator for Unit Testing Signed-off-by: d067928 <[email protected]> * Refactor QuotaCalculator for LocalData Property Access and Write Tests Signed-off-by: d067928 <[email protected]> * Use Instant on the Device Read since this is not timezone specific Signed-off-by: d067928 <[email protected]> * Add specific state for the quota calculation and dedicated rollback Signed-off-by: d067928 <[email protected]> * PR Comments Signed-off-by: d067928 <[email protected]>
* New Scan Confirmation Texts Change (EXPOSUREAPP-2427) (#1097) Co-authored-by: harambasicluka <[email protected]> Co-authored-by: Jakob Möller <[email protected]> * New Strings for Risikobegegnung mit niedrigem Risiko (EXPOSUREAPP-2462) (#1106) * + new strings * let the app not crash on other languages than DE * values for lint and tests * made bad test a comment * removed unnecessary strings * more string fixes Co-authored-by: Jakob Möller <[email protected]> Co-authored-by: Luka Harambasic <[email protected]> * Remove Cache Clearing to reduce CDN load on failing devices (EXPOSUREAPP-2405) (#1108) * Remove Cache Clearing to reduce CDN load on failing devices. This ideally needs to be accompanied by a way to clear the cache manually and a way to identify more root causes of Transaction Failures. Signed-off-by: d067928 <[email protected]> * Remove Files that failed for Key Retrieval Only Remove Files from Cache that failed to download, instead of every file. This is accompanied ideally by no rollback in the Key Retrieval. We only delete the cache ref, the file will not be deleted as it is considered not present Signed-off-by: d067928 <[email protected]> * Introduce dedicated QuotaCalculator for Unit Testing Signed-off-by: d067928 <[email protected]> * Refactor QuotaCalculator for LocalData Property Access and Write Tests Signed-off-by: d067928 <[email protected]> * Use Instant on the Device Read since this is not timezone specific Signed-off-by: d067928 <[email protected]> * Add specific state for the quota calculation and dedicated rollback Signed-off-by: d067928 <[email protected]> * PR Comments Signed-off-by: d067928 <[email protected]> * Feature: Update low risk string (EXPOSUREAPP-1971) (#1125) * Improve Explanation for "Risikobegegnung mit niedrigem Risiko" (EXPOSUREAPP-1971) (#1112) * Adapt QuotaCalculatorTest to old JUnit4 API Signed-off-by: d067928 <[email protected]> * [INTERNAL] Translation delivery: commit by LX Lab (#1132) Change-Id: Ib76a9ea2b03163a05dd8b6acf2179262f9bcf5bf * Removed ar & ru and updated defaults (#1133) * Throw Exception in case we have a failed entry to ensure Abortion of the Transaction (EXPOSUREAPP-2405) (#1134) * Throw Exception in case we have a failed entry to ensure Abortion of the Transaction. Signed-off-by: d067928 <[email protected]> * Adjust test to not expect call to clear cache files Signed-off-by: d067928 <[email protected]> * version bump to 1.3.1 * Reverted replaced wording (EXPOSUREAPP-2638) (#1153) * Fix: No exposure with low risk so far * Fixed klint issues (#1144) * restored reverted replaced wording for lint * #1153 (comment) * fixed term * Align TestFragment Crash behavior with background transaction crash behavior. * Add logging mechanism to debug hotfix issue. * Lint Resolvement, Nav Graph Issue clean, Enable Log for deviceForTesters, Correct Quota Tests due to now lacking exception Signed-off-by: d067928 <[email protected]> Co-authored-by: Philipp Woessner <[email protected]> Co-authored-by: Jakob Möller <[email protected]> Co-authored-by: Rituraj Sambherao <[email protected]> Co-authored-by: harambasicluka <[email protected]> Co-authored-by: chris-cwa <[email protected]> Co-authored-by: Luka Harambasic <[email protected]> Co-authored-by: SAP LX Lab Service Account <[email protected]> Co-authored-by: Matthias Urhahn <[email protected]>
This ideally needs to be accompanied by a way to clear the cache manually and a way to identify more root causes of Transaction Failures.
Signed-off-by: d067928 [email protected]
This PR reduces the load on the CDN due to failing Transactions. We currently do not have this Rollback behavior on iOS and the initial reason for this was due to the fear of corrupt Key Packages. It can be tested by either manually inserting an error or provoking a transaction failure on other ways in the Key Retrieval Process.