feat: RPC fallback for missing DAG definitions on workers#2271
Draft
four-bytes-robby wants to merge 1 commit into
Draft
feat: RPC fallback for missing DAG definitions on workers#2271four-bytes-robby wants to merge 1 commit into
four-bytes-robby wants to merge 1 commit into
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
329b0ee to
ffb7e07
Compare
Adds GetDAG RPC to coordinator service allowing workers to fetch missing DAG definitions on demand when the local DAG store misses. This eliminates race conditions in git-synced setups where new DAG YAML may not yet be present on the worker. - New gRPC: GetDAG RPC in coordinator proto (GetDAGRequest/GetDAGResponse) - Coordinator: dagsStore field + GetDAG handler (returns YAML spec by name) - Client: GetDAG(ctx, name) method on coordinator.Client - Agent: RemoteDAGLoader func type + option, wired through dbClient - dbClient: local-first lookup with RPC fallback on miss - Worker: RemoteDAGLoader closure using coordinator client GetDAG - Context: DAGStore field added, populated at init, passed to coordinator
ffb7e07 to
87f00ae
Compare
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.
Closes #2259
Problem
When a worker executes a sub-DAG via
dag.runand the DAG YAML is not yet present in its local store, the step fails. This creates a race condition in git-synced setups:Solution
Workers fetch missing DAG definitions from the coordinator on demand via a new
GetDAGRPC as a fallback when the local store misses.Changes
GetDAGRPC in coordinator proto withGetDAGRequest/GetDAGResponsedagStorefield +GetDAGimplementation (returns YAML spec by name, returnsUnimplementedwhen dagStore is nil)GetDAG(ctx, name)method added toClientinterface + implementationdbClient:RemoteDAGLoaderfunction type wired through agent options →dbClient.GetDAG()tries local-first, then RPC fallback on missremote_handler: closure using coordinator clientGetDAG+spec.LoadYAMLto parse remote YAMLcmd/coord.go+context.go:DAGStorewired into coordinator startupData Flow
Testing
go build ./...— cleango vet ./...— clean (no new issues)agent,coordinator,worker,cmd,frontend/api/v1Notes
dagStoreon coordinator is optional (returnsUnimplementedif nil)RemoteDAGLoaderdefaults to nil → no fallback attempted on workers without a coordinator clientSummary by cubic
Adds an RPC fallback so workers can fetch missing DAG YAML from the coordinator when local DAGs aren’t synced yet, preventing sub-DAG failures. Addresses #2259 by eliminating race conditions in git-synced setups.
GetDAGto thecoordinatorservice (GetDAGRequest/GetDAGResponse) to serve DAG YAML from theDAGStore(returns Unimplemented if no store).coordinatorclient withGetDAG(ctx, name); workers now try local-first and fall back to RPC on miss.RemoteDAGLoaderin the agent and wired it throughdbClient; workerremote_handlerfetches YAML and parses viaspec.LoadYAML.DAGStorecreation into command context and coordinator startup (includingstartall) so the RPC can read DAG definitions.Written for commit 87f00ae. Summary will update on new commits.