Skip to content

Conversation

@Ian-Nara
Copy link
Contributor

@Ian-Nara Ian-Nara commented Nov 12, 2025

Rough Usage:

if no manual_override set in S3 config (key not present):
    status = calculator.calculateStatus(messages)
    if status == DELAYED_PROCESSING:
        set manual_override in S3 to DELAYED_PROCESSING // requires engineer remove the flag
else:
    status = value from S3

private final int thresholdMultiplier;
private final ICloudStorage cloudStorage;
private final String s3DeltaPrefix; // (e.g. "optout-v2/delta/")
private final String whitelistS3Path; // (e.g. "optout-breaker/traffic-filter-config.json")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we reuse the same S3 bucket just different folder?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, optout-v2 is top-level folder within the bucket, optout-breaker would also be folder in same bucket


private long getTotalWhitelistDuration() {
long totalDuration = 0;
for (List<Long> range : this.whitelistRanges) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There probably are several whitelist ranges, some within the first 24 hours, others in the 24–48 hour range, or even older if we don’t clear them. Maybe we should check the whitelist duration during specific time ranges instead of calculating over the entire period every time?


try {
// Get list of delta files from S3 (sorted newest to oldest)
List<String> deltaS3Paths = listDeltaFiles();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can check the time it spends to list all delta files names in 3 months versus list 7 days delta file names.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need to optimize this. We get 1000 objects per list API call, with CloudStorageS3 handling the pagination automatically. Should only take a second or two to list all the deltas, we can check on it after deploy/test?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool. Yeah, maybe we need to monitor this later.

@Ian-Nara Ian-Nara marked this pull request as ready for review November 14, 2025 00:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants