Repository navigation
feat(clients): better IPFS timeout handling - #3745
Merged
Merged
Conversation
Test Results 5 files ±0 211 suites ±0 57m 13s ⏱️ + 1m 46s Results for commit 9027fe8. ± Comparison against base commit 9a5abbb. This pull request removes 1 and adds 3 tests. Note that renamed tests count towards both.♻️ This comment has been updated with latest results. |
Alenar
temporarily deployed
to
testing-2-preview
December 2, 2026 14:58 — with
GitHub Actions
Inactive
Alenar
temporarily deployed
to
testing-preview
December 2, 2026 14:58 — with
GitHub Actions
Inactive
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The review record identifies no active issues, and the documented IPFS retry, disabled-source feedback, and forward-compatible enum changes support the requested improvements.
No open issues 🎉
What changed in this PR
Improves client IPFS downloads by retrying slow Kubo files/stat requests, notifying users when IPFS is disabled, and making feedback enums forward-compatible.
Changes:
- Added progressive existence-check timeouts and circuit-breaker feedback.
- Added CLI warnings and JSON cautions for disabled IPFS sources.
- Updated documentation and changelog.
- A moderate issue remains: connection timeouts are retried instead of immediately tripping the circuit breaker; a test name also has a grammatical nit.
| File | Description |
|---|---|
| mithril-client/src/file_downloader/ipfs.rs | Implements progressive timeout retries for IPFS existence checks and adds tests. |
| mithril-client/src/feedback.rs | Adds the source-disabled feedback event and non-exhaustive feedback enums. |
| mithril-client/src/cardano_database_client/download_unpack/internal_downloader.rs | Integrates the IPFS circuit breaker with the download flow. |
| mithril-client/src/cardano_database_client/download_unpack/download_task/task.rs | Triggers circuit-breaker handling asynchronously during downloads. |
| mithril-client/src/cardano_database_client/download_unpack/download_task/circuit_breaker.rs | Emits the source-disabled event once when the breaker trips. |
| mithril-client-cli/src/utils/multi_download_progress_reporter.rs | Displays source-disabled warnings through progress output. |
| mithril-client-cli/src/utils/mod.rs | Provides shared warning formatting utilities. |
| mithril-client-cli/src/utils/feedback_receiver.rs | Handles source-disabled feedback for CLI output. |
| docs/website/root/manual/develop/nodes/mithril-client.md | Documents IPFS retries and fallback behavior. |
| CHANGELOG.md | Records the IPFS handling and breaking API changes. |
Review effort: Lite
Alenar
force-pushed
the
djo/3680/client-ipfs-better-timeout-handling
branch
from
December 2, 2026 17:44
e9b863b to
96457e7
Compare
damrobi
approved these changes
Dec 3, 2026
A single slow `files/stat` answer of the Kubo node tripped the IPFS circuit breaker for the remaining files of a download. The call is now retried on timeout only (2s, 5s, 10s, then 15s), each attempt warming up the node for the next one, and is reported as unreachable once all attempts time out.
… IPFS circuit breaker trips The circuit breaker is built with the feedback sender, the download id and the type of its download source, and reports its first trip, so client users are told which source is disabled and that the remaining files are downloaded from their other locations instead of finding it only in the logs.
The `DownloadSourceDisabled` feedback event is displayed as a warning through the progress bars (or as a json `caution` with the json output), so users know that the remaining files are downloaded from the other locations.
`MithrilEvent` and `MithrilEventCardanoDatabase` are now `#[non_exhaustive]`, so that adding a feedback event is no longer a breaking change for the users of the library, who must handle unknown events with a wildcard arm. This solve a gap has we should have added this attribute at the same time as those enums.
* mithril-client-cli from `0.14.3` to `0.14.4` * mithril-client from `0.15.5` to `0.15.6`
Alenar
force-pushed
the
djo/3680/client-ipfs-better-timeout-handling
branch
from
December 3, 2026 16:45
96457e7 to
9027fe8
Compare
This branch was successfully deployed
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.
Content
This PR improves the handling of a slow Kubo node during an IPFS download of a Cardano database with the client. A single
files/stattimeout was handled like an unreachable node: it tripped the IPFS circuit breaker and disabled IPFS for all the remaining files, and that was only reported in the logs.This PR includes:
files/statexistence check with increasing timeouts (2s,5s,10sthen15s, instead of a single5sattempt):DownloadSourceDisabled { download_id, source }feedback event, sent once by the circuit breaker when it trips (sourceisIPFS).cautionwhen the JSON output is enabled:MithrilEventandMithrilEventCardanoDatabasefeedback events are now#[non_exhaustive]. Adding the new event was already a breaking change for exhaustive matches, so this change makes future events non-breaking.Pre-submit checklist
Comments
Instead of the counter of consecutive timeouts suggested in the issue, each
files/statcall is retried with increasing timeouts, so the circuit breaker stays a simple on/off switch with no threshold to tune. Once tripped, it is not reset for the rest of the download.The CLI warning is not covered by a test, as the
indicatifoutput can't be captured.With the 15s attempt, a file that ends up falling back to cloud storage now waits at most 32s (2 + 5 + 10 + 15). The docs and the CHANGELOG give no timeout values, so they don't need updating.
Issue(s)
Closes #3680