-
Notifications
You must be signed in to change notification settings - Fork 12
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
DBP: Implement exponential backoff for optout retries #2815
DBP: Implement exponential backoff for optout retries #2815
Conversation
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.
I tested this using the following steps:
- Added a log statement to
calculateNextRunDate
- Ran a profile scan
- Ran opt-outs via debug menu
I didn’t run queued operations, as I think running the opt-outs confirms the expected behavior, but please correct me if I am mistaken @jotaemepereira. The log output was the following, which seems to indicate correctness:
PAST TRIES: 1, NEXT DATE: 7200.0
PAST TRIES: 1, NEXT DATE: 7200.0
PAST TRIES: 1, NEXT DATE: 7200.0
PAST TRIES: 1, NEXT DATE: 7200.0
PAST TRIES: 2, NEXT DATE: 14400.0
PAST TRIES: 2, NEXT DATE: 14400.0
PAST TRIES: 1, NEXT DATE: 7200.0
PAST TRIES: 1, NEXT DATE: 7200.0
PAST TRIES: 3, NEXT DATE: 28800.0
PAST TRIES: 3, NEXT DATE: 28800.0
PAST TRIES: 4, NEXT DATE: 57600.0
PAST TRIES: 4, NEXT DATE: 57600.0
PAST TRIES: 5, NEXT DATE: 115200.0
PAST TRIES: 5, NEXT DATE: 115200.0
PAST TRIES: 6, NEXT DATE: 172800.0
PAST TRIES: 6, NEXT DATE: 172800.0
PAST TRIES: 2, NEXT DATE: 14400.0
PAST TRIES: 2, NEXT DATE: 14400.0
PAST TRIES: 7, NEXT DATE: 172800.0
PAST TRIES: 7, NEXT DATE: 172800.0
PAST TRIES: 8, NEXT DATE: 172800.0
PAST TRIES: 8, NEXT DATE: 172800.0
PAST TRIES: 9, NEXT DATE: 172800.0
PAST TRIES: 9, NEXT DATE: 172800.0
PAST TRIES: 10, NEXT DATE: 172800.0
PAST TRIES: 10, NEXT DATE: 172800.0
PAST TRIES: 3, NEXT DATE: 28800.0
PAST TRIES: 3, NEXT DATE: 28800.0
PAST TRIES: 11, NEXT DATE: 172800.0
PAST TRIES: 11, NEXT DATE: 172800.0
PAST TRIES: 12, NEXT DATE: 172800.0
PAST TRIES: 12, NEXT DATE: 172800.0
PAST TRIES: 13, NEXT DATE: 172800.0
PAST TRIES: 13, NEXT DATE: 172800.0
PAST TRIES: 14, NEXT DATE: 172800.0
PAST TRIES: 14, NEXT DATE: 172800.0
PAST TRIES: 4, NEXT DATE: 57600.0
PAST TRIES: 4, NEXT DATE: 57600.0
PAST TRIES: 15, NEXT DATE: 172800.0
PAST TRIES: 15, NEXT DATE: 172800.0
PAST TRIES: 1, NEXT DATE: 7200.0
PAST TRIES: 1, NEXT DATE: 7200.0
PAST TRIES: 2, NEXT DATE: 14400.0
PAST TRIES: 2, NEXT DATE: 14400.0
PAST TRIES: 16, NEXT DATE: 172800.0
PAST TRIES: 16, NEXT DATE: 172800.0
PAST TRIES: 3, NEXT DATE: 28800.0
PAST TRIES: 3, NEXT DATE: 28800.0
PAST TRIES: 17, NEXT DATE: 172800.0
PAST TRIES: 17, NEXT DATE: 172800.0
PAST TRIES: 4, NEXT DATE: 57600.0
PAST TRIES: 4, NEXT DATE: 57600.0
PAST TRIES: 5, NEXT DATE: 115200.0
PAST TRIES: 5, NEXT DATE: 115200.0
PAST TRIES: 6, NEXT DATE: 172800.0
...
So, based on my understanding of expected behavior and these results, approving. However, as I said @jotaemepereira, please correct me if I missed something.
...kerProtection/Sources/DataBrokerProtection/Operations/OperationPreferredDateCalculator.swift
Show resolved
Hide resolved
...BrokerProtection/Tests/DataBrokerProtectionTests/OperationPreferredDateCalculatorTests.swift
Show resolved
Hide resolved
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, small rename comment
This PR has been inactive for more than 7 days and will be automatically closed 7 days from now. |
52fd81b
to
a847bab
Compare
* main: DBP: Implement exponential backoff for optout retries (#2815) Update UI Tests CI workflows for macOS 13/14 (#2835) Display the addresses in the Debugger UI (#2828) Removing temporary password manager survey code (#2834) Surface specific XPC & login item errors (#2773) DuckPlayer PiP settings (#2830)
Task/Issue URL: https://app.asana.com/0/1204006570077678/1207370913988488/f
Tech Design URL:
CC:
Description:
Implement exponential backoff for opt-out retries
Steps to test this PR:
preferredRunDate
is set after the opt-out fails, it respects the exponential calculation depending on the number of failures. It should never pass theretryError
limit on the broker JSON file (at the moment is 48 hours for all brokers)