Skip to content

/v3/app delete does not wait until service binding are unbound #3333

Open
@johha

Description

@johha

Issue

User tries to call DELETE v3/app/<guid> for an app with a service binding where the service broker does not reply synchronously.
This can result in a failed v3 app deletion job although the service binding is deleted eventually.
App delete job:

{
   "guid":"<guid>",
   "created_at":"2023-06-28T18:46:13Z",
   "updated_at":"2023-06-28T18:46:16Z",
   "operation":"app.delete",
   "state":"FAILED",
   "errors":[
      {
         "detail":"An operation for the service binding between app myapp and service instance slow-broker-service is in progress.",
         "title":"CF-UnprocessableEntity",
         "code":10008
      }
   ],
   "warnings":[
      
   ],
   "links":{
      "self":{
         "href":"https://api.cf.bommel/v3/jobs/<guid>"
      },
      "app":{
         "href":"https://api.cf.bommel/v3/apps/<guid>"
      }
   }
}

Context

The binding deletion is implemented here:
https://github.com/cloudfoundry/cloud_controller_ng/blob/main/app/actions/mixins/bindings_delete.rb#L19-L24

Which is called during app delete:
https://github.com/cloudfoundry/cloud_controller_ng/blob/main/app/actions/app_delete.rb#L101-L104

Possible Expected Results

  • Current behavior
  • App deletion job should wait
  • App deletion job should NOT wait for binding deletion BUT not fail

-> Needs to be discussed

Current result

App deletion job fails although the binding is deleted eventually

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions