Skip to content

Use short timeouts for remote config blob downloads#7210

Merged
rickvdl merged 1 commit into
mainfrom
rickvdl/remote-config-blob-timeouts
Jul 14, 2026
Merged

Use short timeouts for remote config blob downloads#7210
rickvdl merged 1 commit into
mainfrom
rickvdl/remote-config-blob-timeouts

Conversation

@rickvdl

@rickvdl rickvdl commented Jul 14, 2026

Copy link
Copy Markdown
Member

We previously used the default session configuration through URLSessions.shared, which uses a default timeout of 60s. This is rather high, and Android already uses a shorter 5s timeout, so with this PR we bring this in line. We'll use multiple sources for the blob downloads, so a lower timeout should also ensure we'll fallback to the next source sooner.

In a follow up PR (#7185) we'll actually implement dynamic timeouts based on the provided sources as well.


Note

Low Risk
Narrow networking tuning for remote config blobs with faster failure on slow hosts; behavior change is intentional alignment with multi-source fallback, not auth or payment paths.

Overview
Remote config blob downloads no longer use URLSession.shared and its ~60s default timeouts. URLSessionRemoteConfigBlobDownloader now builds a dedicated URLSession whose request and resource timeouts are both 5 seconds, matching Android and speeding failover when multiple blob sources are configured.

A new integration-style unit test stubs a primary URL with URLError.timedOut and a backup with a successful response, asserting RemoteConfigBlobFetcher still completes and persists the blob via the real downloader.

Reviewed by Cursor Bugbot for commit 3a45da0. Bugbot is set up for automated code reviews on this repo. Configure here.

@rickvdl
rickvdl marked this pull request as ready for review July 14, 2026 14:14
@rickvdl
rickvdl requested a review from a team as a code owner July 14, 2026 14:14
@rickvdl

rickvdl commented Jul 14, 2026

Copy link
Copy Markdown
Member Author

@RCGitBot please test

@rickvdl
rickvdl force-pushed the rickvdl/remote-config-blob-timeouts branch from 71bd1fb to 3a45da0 Compare July 14, 2026 14:15
expect(self.blobStore.invokedWriteParameters?.data) == payload
}

func testRealDownloaderUsesFiveSecondTimeoutAndRetriesNextSourceAfterTimeout() async {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This doesn't actually verify the timeout, but that is rather tricky here (we could assert that the user config uses a 5s timeout here, but I'm not sure if that adds much value here? Happy to add it though).

But I realized we don't have a timeout test case at all, so felt like adding this one

@ajpallares ajpallares left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Makes sense! Thanks for adding this!

@rickvdl
rickvdl enabled auto-merge (squash) July 14, 2026 14:18
@rickvdl
rickvdl merged commit f39351e into main Jul 14, 2026
15 of 19 checks passed
@rickvdl
rickvdl deleted the rickvdl/remote-config-blob-timeouts branch July 14, 2026 14:27
This was referenced Jul 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants