Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove redundant locks and transactions #2967

Conversation

philippthun
Copy link
Member

@philippthun philippthun commented Sep 19, 2022

  • When locking an instance, there is no need to explicitly lock its corresponding operation (dependent 1:1 association).
  • As save_with_new_operation (ServiceInstance) now locks the instance and updates itself and the associated operation in a transaction (see [1]), there is no need to wrap it into another transaction in the calling code.

[1] #2916

  • 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

- When locking an instance, there is no need to explicitly lock its
  corresponding operation (dependent 1:1 association).
- As 'save_with_new_operation' (ServiceInstance) now locks the instance
  and updates itself and the associated operation in a transaction (see
  [1]), there is no need to wrap it into another transaction in the
  calling code.

[1] cloudfoundry#2916
@philippthun philippthun marked this pull request as ready for review September 19, 2022 07:58
Copy link
Contributor

@svkrieger svkrieger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea to remove the redundant parts here!

@svkrieger svkrieger merged commit 04aa8e8 into cloudfoundry:main Oct 4, 2022
@svkrieger svkrieger deleted the remove-redundant-locks-and-transactions branch October 4, 2022 12:19
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.

3 participants