Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Add option to skip RW mode check #2133

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

Conversation

cceckman
Copy link
Contributor

WIP: I've not tested this yet.

Adds a config / env option, cache.assume_rw_mode or SCCACHE_ASSUME_RW_MODE. If present, the server skips the startup check of the cache's mode, and assumes it is the one specified. If not present, the server attempts to read and write from the server, and uses the results to determine the mode.

Fixes #2132 (I think - again, I need to work out how to test this properly before sending forward).

@@ -3,6 +3,9 @@
## file

```toml
# If specified, wait this long for the server to start up.
Copy link
Collaborator

Choose a reason for hiding this comment

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

don't hesitate to do this into a different PR as it is unrelated

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure thing: #2134

@codecov-commenter
Copy link

codecov-commenter commented Mar 15, 2024

Codecov Report

Attention: Patch coverage is 53.48837% with 20 lines in your changes are missing coverage. Please review.

Project coverage is 42.28%. Comparing base (0cc0c62) to head (06edc6e).
Report is 15 commits behind head on main.

Files Patch % Lines
src/server.rs 31.25% 3 Missing and 8 partials ⚠️
src/config.rs 65.38% 8 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #2133       +/-   ##
===========================================
+ Coverage   30.91%   42.28%   +11.37%     
===========================================
  Files          53       53               
  Lines       20112    20653      +541     
  Branches     9755     9962      +207     
===========================================
+ Hits         6217     8734     +2517     
+ Misses       7922     7911       -11     
+ Partials     5973     4008     -1965     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@Xuanwo Xuanwo left a comment

Choose a reason for hiding this comment

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

Mostly LGTM, thanks a lot for your work! It's better to find a way to test it. Maybe we can add a new workflow with assume mode enabled?

@sylvestre
Copy link
Collaborator

indeed, it will need some tests before merging this PR!
thanks :)

In the config, `cache.assume_rw_mode`; in the environment,
`SCCACHE_ASSUME_RW_MODE`. The "winning" value, if any is specified, will
cause the server to skip the read/write `check` of the remote backend
and assume that it operates in the given mode.
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.

Hitting rate limiting issues due to .sccache_check write checks on GCS
4 participants