Canonical downloads hide contract-discovery failures
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- csharp
- Domain
- data-engineering
Research direction
Start with CanonicalDataDownloaderDecorator, in particular GetContractsData, where producerTask is started with Task.Run and never observed, and the finally block that calls CompleteAdding. Reproduce with a synthetic IDataDownloader and an IFutureChainProvider that throws on a later date, then enumerate Get to completion. Done means the discovery exception reaches the caller on both the first-date and later-date paths, with tests covering each.
Written by the indexing model from the issue text.
Description
Problem
CanonicalDataDownloaderDecorator does not observe failures from contract discovery. If a future/option chain provider throws, a canonical download can look like either no data or a successfully completed partial download.
Reproduction
Use a synthetic IDataDownloader that returns null for a canonical MNQ future and two minute bars for its dated contract. Set downloader-thread-count to 1 so the sequence is deterministic.
- Request December 8–9, 2025.
- Have
IFutureChainProvider.GetFutureContractListreturn the dated contract for December 8. - On December 9, throw
InvalidOperationException("synthetic later-date discovery failure")instead of returning a chain. - Enumerate the result of
CanonicalDataDownloaderDecorator.Getto completion.
Observed: enumeration ends normally after the earlier contract's data. The discovery exception never reaches the caller. I also tested a provider that throws on its first call: Get returns null and reports no contracts rather than reporting the discovery failure. Both behaviors reproduce with the existing consuming-probe implementation as well as with a probe that preserves the first point.
These are synthetic local reproductions, with no external data-provider requests.
Cause and expected outcome
GetContractsData starts producerTask with Task.Run but never observes that task. GetContracts is lazy, so chain-provider exceptions occur inside the producer. Its finally calls CompleteAdding, making the consumer see normal completion despite the fault.
A fix must distinguish failed contract discovery from a genuinely empty or complete chain. A suggested approach is to observe the producer's failure when consuming the result, including the no-data path; if best-effort partial results are intended, the failure and incompleteness still need to be made explicit. Cover both first-date failure and failure after an earlier contract has produced data.
- Dominant language
- C#
- Stars
- 22.6k
- Forks
- 5.4k
- Avg merge
- 11h 39m
- Merged PRs (30d)
- 104
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from QuantConnect/Lean
-
priority:p2
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
QuantConnect/Lean#10216 ·
Maintainers usually reply within 1 day
-
priority:p2
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
QuantConnect/Lean#10206 ·
Maintainers usually reply within 1 day
-
priority:p2
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
QuantConnect/Lean#10199 ·
Maintainers usually reply within 1 day
-
priority:p2
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
QuantConnect/Lean#10198 ·
Maintainers usually reply within 1 day
-
priority:p2
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
QuantConnect/Lean#10197 ·
Maintainers usually reply within 1 day
All issues in QuantConnect/Lean
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
dotnet-outdated/dotnet-outdated#871 ·
Maintainers usually reply within 1 day
-
triage/untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
unoplatform/uno#26676 ·
Maintainers usually reply within 1 day
-
.NET bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
jhaizhou-ops/S2Arm#2177 · 3 comments ·
Maintainers usually reply within 1 day
-
area-CodeGen-coreclr untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
dotnet/runtime#138181 · 1 comment ·
Maintainers usually reply within 1 day