fix: worker execution takeover issue

This commit is contained in:
yashsinghcodes
2026-01-13 02:18:31 +05:30
parent 5e80a9e9be
commit 28d0dc42db
+10 -7
View File
@@ -3049,13 +3049,16 @@ 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)
workflowExecution, err = getWorkerBackendExecution(actionResult.Authorization, actionResult.ExecutionId) return
if err != nil {
log.Printf("[ERROR] Failed getting execution (streamresult) %s: %s", actionResult.ExecutionId, err) // This was causing the worker to take over parent execution in hybrid mode
resp.WriteHeader(400) // workflowExecution, err = getWorkerBackendExecution(actionResult.Authorization, actionResult.ExecutionId)
resp.Write([]byte(fmt.Sprintf(`{"success": false, "reason": "Bad authorization key or execution_id might not exist."}`))) // if err != nil {
return // log.Printf("[ERROR] Failed getting execution (streamresult) %s: %s", actionResult.ExecutionId, err)
} // 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