Ignore ResourceExists errors from bbs_apps_client#4522
Merged
Conversation
Gerg
commented
Aug 18, 2025
| rescue CloudController::Errors::ApiError => e # catch race condition if Diego Process Sync creates an LRP in the meantime | ||
| if e.name == 'RunnerError' && e.message['the requested resource already exists'] | ||
| existing_lrp = client.get_app(process) | ||
| client.update_app(process, existing_lrp) |
Member
Author
There was a problem hiding this comment.
We do lose out on this update. I think the syncer will get to it anyway (or already got to it, since this is a race condition). I'll think about it some more.
Member
Author
There was a problem hiding this comment.
Yea, looking at client.update_app, it's getting the LRP based on the CC process's guid and version. If the versions match between the LRP and the CC process, then no update is needed (that's the purpose of version).
Thus, I don't think this additional update is needed.
Member
Author
|
Discovered while reviewing #4452 |
Member
Author
|
Reproduction steps: |
- This is a re-implementation of 133486e - This error can be raised by BBS when there is a race condition between the CC syncer and CC API when creating an LRP for a process - Since we want to desire a process anyway, it already existing (with the correct version) is likely not an error case. Thus, we can behave idempotently. - Improvements from previous implementation: - No longer ignores other types of APIErrors in desire_app_handler.rb - No longer coupled to the exact error message coming from BBS
3e52839 to
c2d496a
Compare
Previous:
```
"error":{"descriptor":[{},{}]}}
```
Improved:
```
"error":"\u003cDiego::Bbs::Models::Error: type: :ResourceExists, message: \"the requested resource already exists\"\u003e"
```
Member
Author
Manual testing
Results:
|
sethboyles
approved these changes
Sep 11, 2025
ari-wg-gitbot
added a commit
to cloudfoundry/capi-release
that referenced
this pull request
Sep 15, 2025
Changes in cloud_controller_ng:
- Ignore ResourceExists errors from bbs_apps_client
PR: cloudfoundry/cloud_controller_ng#4522
Author: Greg Cobb <greg.cobb@broadcom.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
the CC syncer and CC API when creating an LRP for a process
the correct version) is likely not an error case. Thus, we can behave
idempotently.
desire_app_handler.rb