- 
                Notifications
    You must be signed in to change notification settings 
- Fork 2.9k
[WIP] fix: restore parallel processing in workflow & file proto #6493
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
base: dev
Are you sure you want to change the base?
[WIP] fix: restore parallel processing in workflow & file proto #6493
Conversation
add missing `go` keyword to anonymous funcs that were intended to run as goroutines but were executing synchronously instead. Fixes #6492 Signed-off-by: Dwi Siswanto <git@dw1.io>
| Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the  You can disable this status message by setting the  WalkthroughIntroduces concurrent execution by adding goroutines to two previously synchronous inline functions. Workflow template steps and file path processing are now launched with go func(...) { ... }(...), using existing WaitGroups for synchronization. Error handling and logging remain unchanged. No public APIs were modified. Changes
 Sequence Diagram(s)sequenceDiagram
  autonumber
  actor Runner as Executor
  participant WG as WaitGroup
  participant T1 as Template[#1]
  participant Tn as Template[#N]
  Note over Runner: Workflow execution (new)
  Runner->>WG: Add(N)
  par For each template
    Runner--)T1: go runWorkflowStep(t1,...)
    T1-->>WG: Done (defer)
  and
    Runner--)Tn: go runWorkflowStep(tn,...)
    Tn-->>WG: Done (defer)
  end
  Runner->>WG: Wait()
  WG-->>Runner: All complete
  Note over Runner: Errors logged per template
sequenceDiagram
  autonumber
  actor Caller as File Request
  participant WG as WaitGroup
  participant F1 as File[#1]
  participant Fn as File[#N]
  Note over Caller: File processing (new)
  Caller->>WG: Add(N)
  par For each file
    Caller--)F1: go processFile(f1)
    F1-->>WG: Done (defer)
  and
    Caller--)Fn: go processFile(fn)
    Fn-->>WG: Done (defer)
  end
  Caller->>WG: Wait()
  WG-->>Caller: All complete
  Note over Caller: Errors logged per file
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
 Pre-merge checks and finishing touches✅ Passed checks (5 passed)
 Comment  | 
Signed-off-by: Dwi Siswanto <git@dw1.io>
Signed-off-by: Dwi Siswanto <git@dw1.io>
* replace hardcoded `DEBUG` env var check with extensible helper func. * add support for GitHub Actions Runner env var. * accept multiple truthy value variants. Signed-off-by: Dwi Siswanto <git@dw1.io>
caused by shared context callbacks. it was exposed after adding concurrent exec to workflow processing and occurred when multiple goroutines attempted to write to the same `ctx.OnResult` callback field simultaneously, causing data races during workflow template exec. Signed-off-by: Dwi Siswanto <git@dw1.io>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
implementation: lgtm!
Fix: failing tests
Proposed changes
add missing
gokeyword to anonymous funcs thatwere intended to run as goroutines but were
executing synchronously instead.
Fixes #6492
Proof
this PR
dev
Note
Apply bcf7a90 patch first.
Checklist
Summary by CodeRabbit