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

Add transaction scope around postgres ‘find_by_sql’ statement #79

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nimast
Copy link

@nimast nimast commented Jan 7, 2014

This is in order to prevent multiple instances of DJ from picking up the same task (as the current locking of FOR UPDATE will suffice for a single connection, when scaled out our workers seemed to have been picking up the same job on different machines)

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 723ff09 on nimast:feature/postgres-reserve-transaction into * on collectiveidea:master*.

unionsmarket added a commit to unionsmarket/delayed_job_active_record that referenced this pull request Jan 16, 2014
@sferik sferik force-pushed the master branch 2 times, most recently from b3f2a9b to b3adaee Compare October 8, 2014 16:39
@sferik sferik force-pushed the master branch 2 times, most recently from 1240e8d to 639c9e5 Compare December 22, 2014 17:16
@nimast
Copy link
Author

nimast commented Jan 14, 2017

@ericcj See the part regarding multiple users in the second post you mentioned. Perhaps serializable isolation level would also fix this issue, but adding a transaction scope solved it too.

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