<#5547 [BUG] Workflow status is stuck at Aborting>...
# flyte-github
c
#5547 [BUG] Workflow status is stuck at Aborting Issue created by pingsutw ### Describe the bug https://flyte-org.slack.com/archives/CP2HDHKE1/p1720478153981989 Workflow status is stuck at Aborting and task status is stuck at Running Forever when I abort the workflow [Screenshot 2024-07-09 at 10 50 21 AM](https://private-user-images.githubusercontent.com/37936015/347062920-5424cf32-83f6-4d96-baca-65d10d912e51.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NDgyMTg1MzIsIm5iZiI6MTc0ODIxODIzMiwicGF0aCI6Ii8zNzkzNjAxNS8zNDcwNjI5MjAtNTQyNGNmMzItODNmNi00ZDk2LWJhY2EtNjVkMTBkOTEyZTUxLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTA1MjYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwNTI2VDAwMTAzMlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTcyZDNlMmE0NGY3YjQ1ZjU3N2U0N2YzNjcxNzA5YzdlZGI0MjMyNzhmNjgxZTIzNWU1NmM4NzM5Y2IxMWVlZjMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.VoxtjApO5naWak9t8DMtkxhIuGtsMYCJiJSh2bGQ6nc) Minimal repro:
Copy code
flytectl demo start
pyflyte run --remote wf.py wf
flytectl demo start # restart the demo cluster; it will delete the CRD, and the propeller won't propagate the event to admin.
@task(enable_deck=True) def t1(a: int) -> int: sleep(3000) return a + 1 @workflow def wf() -> int: return t1(a=3) ### Expected behavior The status should transition to
aborted
### Additional context to reproduce We do nothing if CRD doesn't exist when deleting the workflow here. We should make sure the workflow status is
aborted
before returning
nil
func (e K8sWorkflowExecutor) Abort(ctx context.Context, data interfaces.AbortData) error { target, err := e.executionCluster.GetTarget(ctx, &executioncluster.ExecutionTargetSpec{ TargetID: data.Cluster, }) if err != nil { return errors.NewFlyteAdminErrorf(codes.Internal, err.Error()) } err = target.FlyteClient.FlyteworkflowV1alpha1().FlyteWorkflows(data.Namespace).Delete(ctx, data.ExecutionID.GetName(), v1.DeleteOptions{ PropagationPolicy: &deletePropagationBackground, }) // An IsNotFound error indicates the resource is already deleted. if err != nil && !k8_api_err.IsNotFound(err) { return errors.NewFlyteAdminErrorf(codes.Internal, "failed to terminate execution: %v with err %v", data.ExecutionID, err) } // TODO: make sure the workflow status is aborted here. If it's not, we should update the status. return nil } ### Screenshots ### Are you sure this issue hasn't been raised already? • Yes ### Have you read the Code of Conduct? • Yes flyteorg/flyte