Make remote custom-data downloads robust to transient empty/failed responses#9544
Open
Martin-Molinero wants to merge 2 commits into
Open
Make remote custom-data downloads robust to transient empty/failed responses#9544Martin-Molinero wants to merge 2 commits into
Martin-Molinero wants to merge 2 commits into
Conversation
A remote custom-data source can intermittently answer with a transient failure or a successful-but-empty body (e.g. an HTTP 200 with no content from a proxied endpoint). Previously a single such response made RemoteFileSubscriptionStreamReader treat it as the file contents: an empty byte[] passed the 'bytes != null' check and was written/cached as a valid (empty) file, so the whole subscription silently yielded no data and, with caching enabled, reused the empty file. Download with a bounded retry that treats an empty response or an exception as transient, and only persist/cache a non-empty result. On HTTP errors a WebException is still thrown after the retries are exhausted, preserving existing behavior. Adds tests: retry recovers after empty responses, and an empty download is not cached.
jaredbroad
approved these changes
Jun 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this does
RemoteFileSubscriptionStreamReadertreated a successful-but-empty download (byte[0], e.g. a transient HTTP 200 with no body) as valid: it passed thebytes != nullcheck and was written/cached as an empty file, so the subscription silently yielded no data (and the empty file was reused with caching on). This:Scope (honest)
This recovers transient empties. It does not fix a sustained endpoint outage — if the remote source returns empty for the whole run, there's no data to get and the subscription still yields nothing. So this reduces, but does not eliminate, flakiness for regression algorithms that depend on a live remote source (e.g.
CustomDataPropertiesRegressionAlgorithmfetching a Quandl/Nasdaq proxy URL). Fully de-flaking those needs the test data served locally/deterministically rather than from a live endpoint — a separate change.Tests
RetriesTransientEmptyDownload,EmptyDownloadIsNotCachedpass; Engine + Tests build clean.🤖 Generated with Claude Code