fix: worker takeover for parent workflow execution

This commit is contained in:
yashsinghcodes
2026-01-13 03:02:38 +05:30
parent 28d0dc42db
commit cabe871807
+8 -11
View File
@@ -2565,7 +2565,7 @@ func getWorkerBackendExecution(auth string, executionId string) (*shuffle.Workfl
log.Printf("[INFO] Here is the result we got back from backend: %s", workflowExecution.Results) log.Printf("[INFO] Here is the result we got back from backend: %s", workflowExecution.Results)
} }
setWorkflowExecution(context.Background(), *workflowExecution, false) //setWorkflowExecution(context.Background(), *workflowExecution, false)
return workflowExecution, nil return workflowExecution, nil
} }
@@ -3049,16 +3049,13 @@ func handleGetStreamResults(resp http.ResponseWriter, request *http.Request) {
workflowExecution, err := shuffle.GetWorkflowExecution(ctx, actionResult.ExecutionId) workflowExecution, err := shuffle.GetWorkflowExecution(ctx, actionResult.ExecutionId)
if err != nil { if err != nil {
log.Printf("[WARNING][%s] Failed to find execution in cache requesting backend (4): %s", actionResult.ExecutionId, err) log.Printf("[WARNING][%s] Failed to find execution in cache requesting backend (4): %s", actionResult.ExecutionId, err)
return workflowExecution, err = getWorkerBackendExecution(actionResult.Authorization, actionResult.ExecutionId)
if err != nil {
// This was causing the worker to take over parent execution in hybrid mode log.Printf("[ERROR] Failed getting execution (streamresult) %s: %s", actionResult.ExecutionId, err)
// workflowExecution, err = getWorkerBackendExecution(actionResult.Authorization, actionResult.ExecutionId) resp.WriteHeader(400)
// if err != nil { resp.Write([]byte(fmt.Sprintf(`{"success": false, "reason": "Bad authorization key or execution_id might not exist."}`)))
// log.Printf("[ERROR] Failed getting execution (streamresult) %s: %s", actionResult.ExecutionId, err) return
// resp.WriteHeader(400) }
// resp.Write([]byte(fmt.Sprintf(`{"success": false, "reason": "Bad authorization key or execution_id might not exist."}`)))
// return
// }
} }
// Authorization is done here // Authorization is done here