Skip to content

feat: Enable RetryLayer for OpenDAL powered services - #1700

Closed
Xuanwo wants to merge 13 commits into
mozilla:mainfrom
Xuanwo:enable-retry-layer
Closed

Xuanwo wants to merge 13 commits into
mozilla:mainfrom
Xuanwo:enable-retry-layer

Conversation

@Xuanwo

@Xuanwo Xuanwo commented Mar 29, 2023 •

Copy link
Copy Markdown
Collaborator

This pull request will add a retry layer to services powered by OpenDAL. The purpose of this layer is to assist users in avoiding temporary network errors.

  • fs is not powered by opendal now, so not enabled.

Xuanwo added 2 commits March 29, 2023 14:51
Signed-off-by: Xuanwo <[email protected]>
@sylvestre

Copy link
Copy Markdown
Collaborator

Do you have more details about the retry ?
How many times will it try? Any delay between retries? thanks

Xuanwo added 2 commits March 29, 2023 15:09
Signed-off-by: Xuanwo <[email protected]>
Signed-off-by: Xuanwo <[email protected]>
@Xuanwo

Xuanwo commented Mar 29, 2023

Copy link
Copy Markdown
Collaborator Author

How many times will it try? Any delay between retries? thanks

Update in comments.

Signed-off-by: Xuanwo <[email protected]>
Comment thread docs/Configuration.md Resolved
Co-authored-by: Sylvestre Ledru <[email protected]>
@codecov-commenter

codecov-commenter commented Mar 29, 2023 •

Copy link
Copy Markdown

Codecov Report

Patch coverage: 10.52% and project coverage change: -0.01 ⚠️

Comparison is base (534f4e9) 29.42% compared to head (3ad474b) 29.41%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1700      +/-   ##
==========================================
- Coverage   29.42%   29.41%   -0.01%     
==========================================
  Files          49       49              
  Lines       17056    17048       -8     
  Branches     8269     8250      -19     
==========================================
- Hits         5019     5015       -4     
+ Misses       6998     6987      -11     
- Partials     5039     5046       +7     
Impacted Files Coverage Δ
src/cache/azure.rs 0.00% <0.00%> (ø)
src/cache/gcs.rs 10.00% <0.00%> (+0.19%) ⬆️
src/cache/gha.rs 0.00% <0.00%> (ø)
src/cache/memcached.rs 0.00% <0.00%> (ø)
src/cache/redis.rs 0.00% <0.00%> (ø)
src/cache/s3.rs 47.82% <0.00%> (+1.01%) ⬆️
src/cache/webdav.rs 0.00% <0.00%> (ø)
tests/harness/mod.rs 44.18% <ø> (ø)
tests/oauth.rs 0.64% <ø> (ø)
src/cache/cache.rs 39.77% <10.71%> (+0.59%) ⬆️
... and 1 more

... and 12 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@sylvestre

Copy link
Copy Markdown
Collaborator

you enabled it for gha finally ?

@Xuanwo

Xuanwo commented Mar 30, 2023 •

Copy link
Copy Markdown
Collaborator Author

you enabled it for gha finally ?

Let's take a look if it works well on gha.

@sylvestre

Copy link
Copy Markdown
Collaborator

Let's take a look if it works well on gha.

How are you going to know if it works well ?

Comment thread docs/Configuration.md Resolved
Co-authored-by: Sylvestre Ledru <[email protected]>
Comment thread src/cache/cache.rs
if !config.disable_cache_retry {
// RetryLayer will retry requests when meeting temporary
// errors returned by OpenDAL. For example, network
// unreachable, timeout and so on.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

is there a list of errors that will trigger a retry ?

@Xuanwo Xuanwo Apr 6, 2023 •

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

is there a list of errors that will trigger a retry ?

They are implementation details that may vary depending on the services. So I can't list them all here.

Comment thread docs/Configuration.md Resolved
@Xuanwo

Xuanwo commented May 10, 2023

Copy link
Copy Markdown
Collaborator Author

Closed for too many conflicts.

@Xuanwo Xuanwo closed this May 10, 2023
@Xuanwo
Xuanwo deleted the enable-retry-layer branch May 10, 2023 04:01
shm11C3 added a commit to shm11C3/HardwareVisualizer that referenced this pull request Sep 14, 2026
Verification on run 34865702849 showed 0% cache hits and ~100% write
errors in every duckdb-archive job: sccache's SCCACHE_GHA_ENABLED
backend issues one live PUT per compiled object, and GitHub rate-limits
writes per workflow run, shared across every job in it. sccache's GHA
backend installs no retry layer (mozilla/sccache#2821, open and
unfixed; a 2023 attempt at the fix, mozilla/sccache#1700, was closed
unmerged for conflicts), so a rate-limited write is dropped, not
retried. This repository runs duckdb-archive in three job kinds across
three platforms, up to nine concurrent writers in one run, matching
the reported failure mode exactly.

Switch to sccache's default local disk cache (SCCACHE_DIR under
runner.temp) wrapped in a plain actions/cache step, the same
save-once-per-job-at-job-end mechanism setup-rust's rust-cache step
and this repository's AppRun/WiX caches already use successfully. This
sidesteps the bug entirely: there is no per-object live write to rate
limit, only one archive upload per job.

Key: sccache-<job-kind>-<os>-<Cargo.lock hash>, with a job-kind+os
restore-keys prefix so unrelated Cargo.lock churn still restores the
nearest older sccache directory. Saves are intentionally not
restricted to develop, since the key already collapses to develop's
key whenever Cargo.lock matches, so pull requests saving does not
multiply entries per run; SCCACHE_CACHE_SIZE is capped at 1G per job
to bound growth against the repository's cache budget.
shm11C3 added a commit to shm11C3/HardwareVisualizer that referenced this pull request Sep 16, 2026
* ci: cache the bundled DuckDB C++ build with sccache

CI run 34850128330 (test-core, windows-latest) spent about 9 of its 13m53s
build phase in `Compiling libduckdb-sys v1.10505.0`, the bundled DuckDB
C++ build, and repeats it on every cold build. Add
.github/actions/cache-duckdb, which installs sccache
(mozilla-actions/sccache-action, pinned) and exports
SCCACHE_GHA_ENABLED=true and RUSTC_WRAPPER=sccache, and run it after
setup-rust in the three ci.yml jobs that compile with
`--features duckdb-archive` (lint-core, test-core, lint-tauri). The cc
crate (1.2.67) treats RUSTC_WRAPPER=sccache as a C/C++ compiler wrapper,
so each cl.exe / c++ invocation of the 326 DuckDB translation units is
keyed on preprocessed source, flags and compiler and served from the
GitHub Actions cache; non-incremental Rust dependency crates get the same
treatment. cc emits -Z7 for MSVC, which sccache accepts.

A dedicated actions/cache entry for target/debug/build/libduckdb-sys-*/out
was rejected: Cargo has no early cutoff, so the run-build-script unit is
re-run whenever its build-script-build binary or any of that binary's
dependencies was rebuilt in the same invocation
(FsStatus::StaleDepFingerprint), or whenever the binary's mtime is newer
than the restored `output` file. The restored directory would survive only
when the whole build-dependency closure is already fresh in target/, which
rust-cache already covers. Details and known misses are documented in the
action and in docs/development/local-build-cache.md.

Validation: actionlint 1.7.12 reports no findings at the changed lines
(remaining findings are the pre-existing background/wait-all steps and the
disabled lint-actions job). Cache hit rates need a CI run; sccache's post
step prints them.

* fix: switch DuckDB build cache from sccache's GHA backend to local disk

Verification on run 34865702849 showed 0% cache hits and ~100% write
errors in every duckdb-archive job: sccache's SCCACHE_GHA_ENABLED
backend issues one live PUT per compiled object, and GitHub rate-limits
writes per workflow run, shared across every job in it. sccache's GHA
backend installs no retry layer (mozilla/sccache#2821, open and
unfixed; a 2023 attempt at the fix, mozilla/sccache#1700, was closed
unmerged for conflicts), so a rate-limited write is dropped, not
retried. This repository runs duckdb-archive in three job kinds across
three platforms, up to nine concurrent writers in one run, matching
the reported failure mode exactly.

Switch to sccache's default local disk cache (SCCACHE_DIR under
runner.temp) wrapped in a plain actions/cache step, the same
save-once-per-job-at-job-end mechanism setup-rust's rust-cache step
and this repository's AppRun/WiX caches already use successfully. This
sidesteps the bug entirely: there is no per-object live write to rate
limit, only one archive upload per job.

Key: sccache-<job-kind>-<os>-<Cargo.lock hash>, with a job-kind+os
restore-keys prefix so unrelated Cargo.lock churn still restores the
nearest older sccache directory. Saves are intentionally not
restricted to develop, since the key already collapses to develop's
key whenever Cargo.lock matches, so pull requests saving does not
multiply entries per run; SCCACHE_CACHE_SIZE is capped at 1G per job
to bound growth against the repository's cache budget.

* docs: tighten cache-restore and publish.yml trigger wording

CodeRabbit review on cc457ae:
- "nearest older archive" implied a content-based closeness that
  actions/cache's restore-keys does not provide; it restores the most
  recently created matching archive. Reworded in both the doc and the
  matching action.yml comment.
- publish.yml also declares workflow_dispatch, so its save-if is not
  unconditionally false: a manual dispatch on develop does satisfy it.
  Reworded to describe both triggers.

Declined the third finding (that a PR's own actions/cache save is not
actually skipped when its key matches develop's): actions/cache scopes
restores across branches for the default branch specifically ("The
default branch cache is available to other branches", per its README),
and saveImpl.ts skips the save whenever the restored key exactly
matches the primary key, regardless of which branch's entry satisfied
that match. A PR whose Cargo.lock matches develop's therefore does get
an exact-match restore from develop's entry and does skip its own
save, as documented.
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