Skip to content

Avoid one_to_one setter when creating lifecycle data - #5685

Open
philippthun wants to merge 1 commit into
cloudfoundry:mainfrom
sap-contributions:fix-buildpack-lifecycle-deadlock
Open

philippthun wants to merge 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.

  • 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.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

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

1 participant