Skip to content

Avoid one_to_one setter when creating lifecycle data - #5685

Merged
philippthun merged 1 commit into
cloudfoundry:mainfrom
sap-contributions:fix-buildpack-lifecycle-deadlock
Nov 24, 2026
Merged

philippthun merged 1 commit into
cloudfoundry:mainfrom
sap-contributions:fix-buildpack-lifecycle-deadlock

Conversation

@philippthun

@philippthun philippthun commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

The Sequel one_to_one setter issues a no-op un-link UPDATE that deadlocks on MySQL under concurrent app/build/droplet creates. The child is already linked via .create(parent:), so assign nothing and let the association load lazily.

Some specs relied on that un-link UPDATE to clear a second lifecycle data row the factory had already created. Add a :no_lifecycle_data trait so the factory skips that row, instead of depending on the setter to remove it.

This change was developed with AI assistance; all code was reviewed and tested by me.

  • I have reviewed the contributing guide

  • I have viewed, signed, and submitted the Contributor License Agreement

  • I have made this pull request to the main branch

  • I have run all the unit tests using bundle exec rake

  • I have run CF Acceptance Tests

The Sequel one_to_one setter issues a no-op un-link UPDATE that
deadlocks on MySQL under concurrent app/build/droplet creates. The
child is already linked via .create(parent:), so assign nothing and
let the association load lazily.

Some specs relied on that un-link UPDATE to clear a second lifecycle
data row the factory had already created. Add a :no_lifecycle_data
trait so the factory skips that row, instead of depending on the
setter to remove it.
@philippthun
philippthun merged commit 2b1206c into cloudfoundry:main Nov 24, 2026
12 checks passed
ari-wg-gitbot added a commit to cloudfoundry/capi-release that referenced this pull request Nov 24, 2026
Changes in cloud_controller_ng:

- Avoid one_to_one setter when creating lifecycle data
    PR: cloudfoundry/cloud_controller_ng#5685
    Author: Philipp Thun <philipp.thun@sap.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Concurrent app creates deadlock on buildpack_lifecycle_data (MySQL) since #5065: one_to_one setter issues a no-op un-link UPDATE

2 participants