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

Timestamp updated entities outside of the normal flow #1684

Merged
merged 1 commit into from
Dec 2, 2016

Conversation

jrjohnson
Copy link
Member

By moving the timestamping of entities changed and their related changed
sessions and offerings into its own post flush process we will hopefully
avoid deadlocks which have frequently occurred here. I had to use the
query builder instead of just calling stampUpdate on the entities
because when a relationship is deleted in the flush (like
sessionDescription) it still attempts to save it in our postFlush event.
This causes issues so instead I'm only working with the IDs and not the
entities.

Fixes #1683

@jrjohnson
Copy link
Member Author

Comment from @stopfstedt: that we log the deadlocks when we hit them.

@jrjohnson
Copy link
Member Author

Turns out to be unnecessary - I removed the deadlock checking as it was no longer being hit even under heavy load. Regular exceptions will be thrown and logged if we continue to hit this issue.

@jrjohnson jrjohnson assigned stopfstedt and unassigned jrjohnson Dec 1, 2016
By moving the timestamping of entities changed and their related changed
sessions and offerings into its own post flush process we will hopefully
avoid deadlocks which have frequently occurred here. I had to use the
query builder instead of just calling stampUpdate on the entities
because when a relationship is deleted in the flush (like
sessionDescription) it still attempts to save it in our postFlush event.
This causes issues so instead I'm only working with the IDs and not the
entities.
Copy link
Member

@stopfstedt stopfstedt left a comment

Choose a reason for hiding this comment

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

reviewed and click-tested. LGTM.

@stopfstedt stopfstedt merged commit 03b0c00 into ilios:master Dec 2, 2016
@jrjohnson jrjohnson deleted the 1683-deadlock branch December 2, 2016 00:33
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.

None yet

2 participants