Repository navigation
Reapi/worker fixes - #3224
Open
rajputdivyanshu81 wants to merge 7 commits into
Open
Reapi/worker fixes#3224rajputdivyanshu81 wants to merge 7 commits into
rajputdivyanshu81 wants to merge 7 commits into
Conversation
REAPI Action.do_not_cache: "the Action's result cannot be cached". TraceMachina#3135 made the execution server skip the cache lookup and in-flight merging for such actions, but the worker still uploaded their results to the Action Cache. The worker already fetches the Action itself, so it now reads the flag there, carries it on the running action, and skips the AC upload. No worker API change is needed. The historical-results upload, a separate debugging record, and the ExecuteResponse message are unchanged. Refs TraceMachina#3110, TraceMachina#3117 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
REAPI ExecuteResponse.status: "If the status code is other than OK, then the result MUST NOT be cached." The worker decided from the exit code alone, so under success_only (the default) a timed-out action that handled SIGTERM and exited 0 was cached with a DEADLINE_EXCEEDED status, and failures_only cached errored results too. The Action Cache upload now also requires that the result has no error. The historical results store, which is not the Action Cache, is unchanged. Refs TraceMachina#3117 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The directory cache wrote a zero-length input file and returned before the executable handling, so an empty FileNode with is_executable (an empty stub script or wrapper) was materialized without +x. REAPI FileNode.is_executable says the file is executable; its size does not change that. The empty-file shortcut now sets the same read-only mode as any other private copy, via a helper shared with the non-empty path. Refs TraceMachina#3117 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
REAPI Command.output_directories: "Directories leading up to the output directories (but not the output directories themselves) are created by the worker prior to execution". The worker did this for output_files and output_paths only, so a v2.0 client using output_directories could hit a missing parent directory. Refs TraceMachina#3117 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Resolve conflicts in directory_cache.rs, running_actions_manager.rs and protocol-api.mdx. Take upstream's macOS-gated empty-file mode (TraceMachina#3242) and its do_not_cache docs (TraceMachina#3159); keep this branch's error-status rule for the Action Cache and the shared set_input_file_mode helper. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
TraceMachina#3191 and TraceMachina#3242 now set the mode of empty input files in the directory cache on macOS only, a deliberate choice to avoid a chmod per empty file on Linux. Restore main's directory_cache.rs and its test, and remove the docs paragraph that described the dropped behavior. This PR is now the non-OK caching fix and the output_directories parents fix. Refs TraceMachina#3117 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
What and why
Two REAPI conformance fixes for the worker, grouped after the feedback about review cost on #3162. The
do_not_cachepart of this PR already landed separately as #3159, and the empty-executable change was dropped because #3191/#3242 handle empty files on main (macOS only, by design). The plan is in #3117.ExecuteResponse.status: "If the status code is other than OK, then the result MUST NOT be cached." Undersuccess_only, a timed-out action that handled SIGTERM and exited 0 was cached with DEADLINE_EXCEEDED, andfailures_onlycached errored results. The Action Cache upload now also requires that the result has no error. The historical results store, which is not the Action Cache, is unchanged.output_directoriesare created. REAPI: "Directories leading up to the output directories ... are created by the worker prior to execution". This was done foroutput_filesandoutput_pathsonly, so v2.0 clients usingoutput_directoriescould hit a missing parent.Refs #3117
How was this verified?
New tests
result_with_error_status_is_never_cached_in_action_cacheandensure_output_directories_parents_are_created_testeach fail without their fix. At this branch's tip, on current main, these pass locally (Windows, cargo):running_actions_manager_test(57) andlocal_worker_test(26).cargo check --workspace --tests --binsis clean.Risk
Low. Only results that carry an error stop being cached, which the spec requires; the worker also creates directories the spec says must exist.
AI assistance
Claude Code found these during a REAPI conformance audit, wrote the changes and tests, and ran them. I reviewed every line.
🤖 Generated with Claude Code