cloudfoundry / cloudfoundry/cloud_controller_ng

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

Open
#3,333 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

unscheduled
Dominant language
Ruby
Stars
207
Forks
373
Avg merge
2d 12h
Merged PRs (30d)
56

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading app/actions/mixins/bindings_delete.rb and app/actions/app_delete.rb at the referenced call sites to trace how asynchronous service-binding deletion affects the app deletion job. Resolve whether deletion should wait for unbinding or avoid failing while it is in progress, then verify that the chosen behavior no longer produces the reported failed job.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
api, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.